objective-c – UIPageViewController:pageViewController:spi
发布时间:2020-12-16 10:46:02 所属栏目:百科 来源:网络整理
导读:我的spineLocationForInterfaceOrientation-method未被调用;因此,脊柱总是在左边,但我想把它放在中间……我做错了什么? if ([UIPageViewController class]) { self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageView
我的spineLocationForInterfaceOrientation-method未被调用;因此,脊柱总是在左边,但我想把它放在中间……我做错了什么?
if ([UIPageViewController class]) { self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; self.pageViewController.view.backgroundColor = [UIColor redColor]; self.pageViewController.delegate = self; NotesPageController *notesPageController = [[NotesPageController alloc] initWithNibName:@"NotesPageController" bundle:nil]; NSArray *pageViewControllers = [NSArray arrayWithObjects:notesPageController,nil]; [self.pageViewController setViewControllers:pageViewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL]; self.pageViewController.dataSource = self; [self addChildViewController:self.pageViewController]; [self.navigationController pushViewController:self.pageViewController animated:NO]; } 非常感谢! 解决方法
您是否尝试手动设置spine属性?
要设置脊椎位置,请将其中一个常量包装在NSNumber对象中,并将其设置为传递给initWithTransitionStyle:optionsOrientation:options:方法的选项字典中的UIPageViewControllerOptionSpineLocationKey键的值. 参考:http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ruby – 未初始化的常量Mongo ::连接
- Schema.xml和solrconfig.xml属性分析
- Swift 4官方文档中文版/ Basic Operators(上)
- ruby-on-rails – Rails3中的ActionMailer问题. (ssl主机名
- React Native 开发到上线记录(一)
- c – unsigned long long vs unsigned long(可移植性观点)
- 为混合型(Hybrid)深度Linux 11.06叫好
- ruby – 通过Net错误“非绝对主页”:SSH
- 使用ReactiveCocoa实现iOS平台响应式编程
- AVFoundation连续系列之六混音(OC/Swift)