App中其它界面都是竖屏, 只有一个界面是需要横屏的, 怎样使这个界面强制横屏布局?
使用如下这种方式,在需要横屏的页面添加。
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
1 回答834 阅读
2 回答628 阅读
1 回答616 阅读
2 回答619 阅读
1 回答706 阅读
647 阅读
如果需要特定ViewController旋转, 可以为UINavigationController添加Category(类目)UINavigationController+InterfaceOrientation, 然后在指定的ViewController中调用即可.
另外, 推荐一篇博文: http://www.molotang.com/articles/1530.html. 对于不同级别的屏幕旋转梳理的较为清晰.