I have an SQLite database table which contains user selected favorite items. I would like to display these items in a horizontal UIScrollview, with paging enabled, one item per page that the user can swipe through.
Each item’s visual representation on the screen will consist of one UIImage and two or three UILabels.
I’ve used UIScrollview before but only for 2 pages worth, and the content was all created in IB. Now I would like to create the content (from an NSMutableArray perhaps?) programmatically, is there a standard way to go about this?
I could probably go through a for loop of my items and just keep adding to the content size of the UIScrollview, but how would I actually draw the content? Will it all have to be created at once or will it appear as the user swipes?
You only have to add the views as subviews to your scroll view and set the content size accordingly, so it will be scrollable. For example the first view’s frame will be 0,0,300,300, the second view’s 0,350,300,300 and so on.