views:

559

answers:

2

I've been working with a UIScrollView and have about 200 items to scroll through...so far. This doesn't work since it takes around 45 seconds to load all of the views. I've tried loading the first 20 (about 4 seconds) on the main thread then load in blocks of 50 on other threads. I get the first 20 to scroll through but the others don't appear.

It's taken lots of effort just to get the UIScrollView to work properly and there are still some issues. The UITableView will solve all of this for me since it reuses cells. It's similar to the UIScrollView except more efficient.

I'd like to have one cell take up the entire viewing area and have the user flick through each cell. Rather than freely scrolling through cells, scrolling will stop at each cell and the user must flick again for the next cell. The UITableView doesn't do this that I know of. Is there a way to get this behavior with a UITableView?

+1  A: 

Short answer: no.

You can try to control UITableView's scrolling behavior using the delegate methods, or better yet, stick with UIScrollView and load the views one-by-one in the UIScrollViewDelegate methods.

Can Berk Güder
It's still a problem for the scrollview since a user can jump to view 150 in my app. That type of random access will be difficult to handle in a scrollview.
4thSpace
+1  A: 

UITableView is a subclass of UIScrollView. Have you tried simply setting yourTableView.pagingEnabled = YES?

hatfinch
Awesome! Thanks.
4thSpace