iphone - How can I do vertical paging with UITableView? -


Let me describe the situation that what I'm trying to do:

I have There is a list of items when I go to ItemDetailView, which is a UITableView I want to paging here: When I scroll down from the table view, I want to display the next item. Like a good reader:

Currently, I'm trying 2 ways, but both of them do not really work for me 1: I leave my UITT view on my scroll view and I Have a nice animation and sometimes it works just fine except, UITableView will get the event instead of my scroll view and because, a UITableView is already a UITableView, this approach is not a good idea. Here are some code:

  - (zero) Application Definitive Launching: (UIApplication *) Application {// The width of a page scroll view is scrollView.pagingEnabled = YES; ScrollView.contentSize = CGSizeMake (scrollView.frame.size.width, scrollView.frame.size.height * kNumberOfPages); ScrollView.showsHorizontalScrollIndicator = No; ScrollView.showsVerticalScrollIndicator = Yes; ScrollView.scrollsToTop = NO; ScrollView.delegate = self; [Self-loadsviewview page: 0]; } - (zero) loadScrollViewWithPage: (int) page {if (page & lt; 0) returns; Return (page & gt; = kNumberOfPages); [Remove Self.currentViewController.viewPropwerView]; Self.currentViewController = [[[MyNewTableView alloc] initWithPageNumber: page] autorelease]; If (blue == current weekendron.ev. supervivive) {CGRact frame = scrollview frame; [ScrollView Adsview: Current Visitor Controller See]; }} - (zero) scrollviewscroll: (uiscrollview *) sender {if (page control use) {return; } CGFlot PageHite = ScrollView.Frame.im.height; Int page = floor ((scrollView.contentOffset.y - pageHyight / 2) / pageHyight) + 1; [Self loadsview world page: page]; } - (IBAction) changePage: (ID) sender {int page = pageControl.currentPage; [Self loadsview world page: page]; // Update scroll view to the appropriate page; CGTTF frame = scrollableview; [ScrollView scrollRectToVisible: animated frame: yes]; Pagewise use = yes; }  

My second approach is to use the pop and navigation of the navigation controller to pop up the current item dish and push a new push over it. But this approach will not give me a good animation to scroll down like before.

So, how can I get it from any point of view? Answer:

If you do not use any UITableView functionality (except for scrolling), you can simply add a custom view to a UIScrollView ... and enable scrolling pages.


Comments