佚名通过本文主要向大家介绍了ios7锁屏界面,ios7界面,苹果ios7界面,ios7界面设计规范,ios7设置界面等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题:ios7锁屏界面 iOS在某界面强制横屏
描述:
解决方案1:
描述:
假设前一界面是竖屏,我进入新的viewcontroller,我想让当前界面在初始显示时强制横屏,那要怎么写?跪求指导,跪求千万别百度一下然后回答我,baidu的各种答案我试过,不好用。。。。
解决方案1:
http://www.cnblogs.com/niit-soft-518/p/5611298.html
请看博客,这里我整理了三种强制横屏的方法。
大哥 我用你这个方法没成功啊 打断点不会执行 我需要横屏的界面是push出来的第三层
解决方案3:我的需求也是竖屏的tabbarcontroller,push到一个横屏的viewcontroller,返回后还是竖屏,只要在这个viewcontroller中加入以下代码就可以了,只在iOS5+测试过
(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight); }
(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeRight; }
自己回答一下,在你需要横屏的viewcontroller中加入,project中的设置要支持landscaperight
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight); } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeRight; }还有一个问题就是关于转屏是从底部向上的,也就是说,假设当你用navigationcontroller来跳转界面的时候,跳转到的界面的转屏控制与navigationcontroller里的转屏控制是相关的,具体的关联大家自己测试吧