分类: iOS平台
2013-01-21 18:40:06
今天在程序中想实现让UIPageViewController 的翻页方式改为左右滑动
查了半天是通过设置TransitionStyle实现,修改为UIPageViewControllerTransitionStyleScroll,但是测试中发现翻页效果还是原来的,找到苹果的文档
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html#//apple_ref/occ/instm/UIPageViewController/setViewControllers:direction:animated:completion:
enum { UIPageViewControllerTransitionStylePageCurl = 0 UIPageViewControllerTransitionStyleScroll = 1 }; typedef NSInteger UIPageViewControllerTransitionStyle; Constants UIPageViewControllerTransitionStylePageCurl Page curl transition style. When the page curl transition style is specified, the page view controller displays a page-turning animation when transitioning between view controllers. If a data source is specified, the animation follows the user’s finger during a navigation gesture. Available in iOS 5.0 and later. Declared in UIPageViewController.h. UIPageViewControllerTransitionStyleScroll Scrolling transition style. When the page scrolling style is specified, the page view controller displays a page-scrolling animation when transitioning between view controllers. If a data source is specified, the animation follows the user’s finger during a navigation gesture. Available in iOS 6.0 and later. Declared in UIPageViewController.h.
UIPageViewControllerTransitionStyleScroll表示左右滑动 ios6以上支持
UIPageViewControllerTransitionStylePageCurl表示翻页效果,ios5以上支持
我在ios6模拟器下看到了左右滑动效果,在ios5下还是普通翻页效果