简体   繁体   中英

Page control or scroll view for different controller

I want to make a view controller that swipes through 3 different controller (2 table view controllers and a view controller. Each of the 3 child controllers have a custom class. Is better to use a scrollview with paging or a page view controller?

initial screen
       |
       |
-------------------------------------
1) viewcontroller
2) tableviewcontroller
3) tableviewcontroller

If you don't want to do it the proper way with the UIViewController transitioning API introduced in iOS7, you'll have to use UIScrollView with pagingEnabled . (UIPageViewController is meant more for iBook type interfaces, and UIPageViewControllerDelegate's methods aren't very easy to work with, ie. you have to figure the to and from view controllers.) If you go the first route, you will have to implement a bunch of delegates and subclass UIViewController to create a custom parent view controller to put your children (view controller containment).

I've implemented UAFInteractiveNavigationController which should be what you're looking for (with a lot more), but it's relatively untested, written for iOS6-7, and most importantly does not use the more modern UIViewController transitioning API, but does everything from scratch starting with a UIPanGestureRecognizer. I basically ran into a similar problem as you, but found both methods to not be very easy to customize.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM