飞溅景观:
rootvIEw景观:
我期望看起来应该与iPad是纵向模式相同:
飞溅画像:
rootvIEw画像:
rootVIEw是MyNavigationController,一些相关的代码如下:
MyNavigationController.m
- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)interfaceOrIEntation{ return (interfaceOrIEntation == UIInterfaceOrIEntationPortrait);}- (NSUInteger)supportedInterfaceOrIEntations { return UIInterfaceOrIEntationMaskPortrait;}- (BOol)shouldautorotate { return NO;}解决方法 请使用以下代码更正您的代码:
- (BOol)shouldautorotate { return YES;}- (NSUInteger)supportedInterfaceOrIEntations { return UIInterfaceOrIEntationMaskPortrait;}
从shouldautorotate返回YES似乎很奇怪.事实是,如果你确实返回NO,那么根本不会调用supportedInterfaceOrIEntations,你的项目设置就会统治.您也可以删除shouldautorotate,它应该工作相同.
Reference:
总结When the user changes the device orIEntation,the system calls this method on the root vIEw controller or the topmost presented vIEw controller that fills the window. If the vIEw controller supports the new orIEntation,the window and vIEw controller are rotated to the new orIEntation. This method is only called if the vIEw controller’s shouldautorotate method returns YES.
以上是内存溢出为你收集整理的ios – 使用横向模式在iPad上启动iPhone应用程序全部内容,希望文章能够帮你解决ios – 使用横向模式在iPad上启动iPhone应用程序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)