viewController 支持的屏幕方向
来源:互联网 发布:人工智能利弊英语作文 编辑:程序博客网 时间:2024/06/04 19:59
/**控制器设置支持的方向 */
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
/**
UIInterfaceOrientationMaskPortrait = 竖屏,
UIInterfaceOrientationMaskLandscapeLeft = 横屏左边,
UIInterfaceOrientationMaskLandscapeRight = 横屏右边
UIInterfaceOrientationMaskPortraitUpsideDown = 竖屏下边
UIInterfaceOrientationMaskLandscape = (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),横屏左右边
UIInterfaceOrientationMaskAll = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown),所有
UIInterfaceOrientationMaskAllButUpsideDown = (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
} __TVOS_PROHIBITED;
*/
returnUIInterfaceOrientationMaskAll;
}
// - 设置 viewController 的屏幕方向
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIInterfaceOrientationLandscapeLeft] forKey:@"orientation"];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
[[UIDevice currentDevice] setValue: [NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@"orientation"];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//支持旋转
-(BOOL)shouldAutorotate{
return YES;
}
//
//支持的方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
//一开始的方向 很重要
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationLandscapeLeft;
}
- viewController 支持的屏幕方向
- iOS 的Viewcontroller只支持一个屏幕方向,弹出不同方向,旋转
- iOS_关于手机支持的屏幕方向
- iOS_关于手机支持的屏幕方向
- 设置屏幕的方向
- iOS 获取当前屏幕显示的viewcontroller
- 如何获取当前屏幕显示的viewcontroller
- 获取当前屏幕显示的viewcontroller
- iOS //获取当前屏幕显示的viewcontroller
- iOS-获取当前屏幕显示的ViewController
- 获取当前屏幕显示的ViewController
- ios 获取当前屏幕的ViewController
- 获取当前屏幕显示的viewcontroller
- 获取当前屏幕显示的viewcontroller
- 获取当前屏幕显示的viewcontroller
- 获取当前屏幕显示的viewcontroller
- 获取当前屏幕活跃的viewcontroller
- 获取当前屏幕显示的viewcontroller
- runtime
- iOS端实现「节日换肤」通用技术方案(无需更新程序)
- Javascript_备忘录5
- JAVA对象的初始化过程
- js 动态改变url
- viewController 支持的屏幕方向
- iOS app内测TestFlight
- XHProf PHP 分层分析器 php 效率测试 php 优化
- Java CookBook Learning Day4th--HTTP (by Tim O'Brien)
- 【SQL 编程你也行】count函数(SQL Server 2005、2008版本 over partition by)
- android开发游记:listview下拉刷新和上拉加载的实现
- RxAndroid 应用(二)(简易天气App)
- mysql 执行状态分析 show processlist
- Android自动化测试 - Monkey & Monkeyrunner