UICollectionView items flow direction vertical and scroll with horizontal direction - ios

i have UICollectionView, i need Horizontal scroll direction and Vertical items flow. It's possible with native instruments?

You can have a parent UICollectionView scrolling vertically & each section or row can contain child CollectionViews scrolling vertically.
To maintain sanity, do setup your dataSource's for parent & child's independent of each other.
You should be able to utilise same handler for all child collectionViews.

You have add UITableView inside that tableviewcell add the UICollectionView and also set the UICollectionView Scroll Direction is Horizontal.

Related

How to change the direction of filling the UICollectionView?

I would like to know how to change the direction of filling the UICollectionView when the scrolling direction is horizontal. The UICollectionView has 2 rows and 5 columns that are filled up from a one-dimensional array. Thanks.
Horizontal scrolling with vertical filling
Vertical scrolling with Horizontal filling
We can do same Springboard behavior using UICollectionView and for
that, we need to write code for a custom layout. My friend has
achieved it with custom layout class implementation with
SMCollectionViewFillLayout.

One Horizontal and one vertical UICollectionView placed within a UIScrollView iOS Swift

I have two collection views within a scrollview. The above collectionview is a horizontal collectionview and the bottom one is a vertical. I am fetching all the data from api. And when I'm reaching at the bottom of the vertical collection view I need to hit a new api to fetch the new data. I am able to do that with the method willDisplayCell, but with that the problem I'm facing is UIScrollView. I can't scroll properly on my device. The bottom UICollectionView can not be scrolled smoothly. Can anyone suggest me something? Thank you
Do not put your collectionView in scrollView. Instead of doing so, put your horizontal collectionView as headerView in vertical collectionView.

How to make a Horizontal and vertical scrolling TableView in iOS using storyboard?

here is my design structure
I was wondering about creating a horizontal and vertical scrolling tableview. I have tried a tableview inside a scrollview but I failed miserably. What to do?
I use swift4 but I wanted to do in storyboard.
The nature of content is like an excel sheet with lots of horizontal and vertical scrolling rows and columns of data.
Actually you can do this using a hack. Put the tableView inside a scrollView. Then you should give a dynamic width to the tableView by specifying a width in storyboard for tableView or any child view of that scrollView(So we get the horizontal scrolling).You have to adjust some constraints depending on your requirement
Mine worked fine but as many users have said try a collection View if its easy
Note. There is a default scrollView within a tableView, So adjust your height of tableView in a way so the scrollView of tableView work and not the parent scrollView, while scrolling from top to bottom
Instead of using TableView try using collection view, there you can use horizontal and vertical scrolling using storyboard?
Try to use collectionview instead of tableview.
If your requirement demands use of tableview anyhow, then you can use tableview within scrollview.
In tableview within scrollview approach, you need to distinguish your parent scrollview as well as tableview's scrollview. Try to differentiate parent scrollview and tableview's scrollview with different tags. Because both scrollview will call delegate methods of viewcontroller, if implemented. Just check tag of scrollview in all delegate methods of scrollview and perform action accordingly.
As per my understaing you want a view which you want vertical scroll view and horizontal inside it.
So here my suggestion is to use UITABLEVIEW for vertical scrolling and UICOLLECTIONVIEW for horizontal scrolling inside tableview
Both will work fine

Horizontal UICollectionView with Header on Top

I'm kind of stuck with a problem here. I need to create a horizontal scroll Collection View, but when I select to add its header, xcode sticks it on the left side of the cells and I need it to be above the cells, as on the vertical scroll.
Any tips?
embed UICollectionViews in a UITableView like so:

horizontal scrolling for each section in a table view

I want to implement a UICollectionView with multiple sections which each section scrolls horizontally and independently like the attached image
I suggest you to use UITableView with customized UITableViewCells with UIScrollView as subview on its contentViews.
There are many samples, for example here
You can use multiple UICollectionViews in table cells. The tableView will scrolls vertically and The collection views can be configured to scroll horizontally by setting particular set of properties which will restrict them to scroll vertically, and they will only scroll horizontally. One constraint to consider is it is much more difficult to do animations that need to move from one table cell to another and you can't use a neat single change of collection view layout to animate all the items in your table view. But if these constraints aren't a problem then this is a relatively easy solution. I also tried it once. It worked for me. Hope that it works for you as well.

Resources