iOS 控制屏幕横竖屏旋转
當需求有a頁面支持橫屏和豎屏外,其他都是豎屏
我現在的做法是:
1)AppDelegate.m
- (BOOL)shouldAutorotate {
?? return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
????
????return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
????return??UIInterfaceOrientationPortrait;
}
2)A頁面
- (BOOL)shouldAutorotate {
????return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
????
????return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
????return??UIInterfaceOrientationPortrait;
}
?
// 注iOS9?
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
? ? return?UIInterfaceOrientationMaskPortrait;
}
?
轉載于:https://www.cnblogs.com/zero-zql/p/4972807.html
總結
以上是生活随笔為你收集整理的iOS 控制屏幕横竖屏旋转的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 通过url 下载文件
- 下一篇: Android开发之Android Ma