Reputation: 16700
I am trying to create a user profile screen. The screen will have lots of information about a user. It will look similar to this AirB
From the looks of it, it seems to be some sort of scrollView? or is it a tableView or a collectionView? (because it seems that there are some rows in there i think)
Does any one here know how this type of view can be accomplished or can be setup?
EDIT two answers below says to use a UITableview, and 2 other answers says to avoid it. Are there any benefits/disadvantages to using either?
Upvotes: 0
Views: 213
Reputation: 524
Use only one child UIView
as i will call it ContainerView
inside UIScrollView
and then place your child views inside that ContainerView
. Use constraint to trailing and leading and top and bottom of that ContainerView
to UIScrollView
. and use constraint for placing child views to viewController.view not to ContainerView
to then iOS will find where child views have to be.
Good Tutorial to find out how to use constraint on scrollView
Upvotes: 1
Reputation: 109
In one of my app i did same thing using Tableview. And for that tableview i created a custom cell which have such a big height and i added all the images,map,details of user in that. And it work similar to what you want. If you want help reply to my answer
Upvotes: 0
Reputation: 11807
Do Not use tableview in this case, this content is difficult to maintain in a table view, really, use a scrollview, as for how, a simple googling for "swift uiscrollview tutorial"
Upvotes: 1
Reputation: 961
Tableview is the best solution for this kind of scrolling views but in the screen you have mapview if it updates every moment i.e. updates with current location then it is not recommended to use tableview.
In that case you can use scrollview with custom views add subview changing with parameters.
Upvotes: 0