iOS屏幕旋转相关
来源:互联网 发布:办公软件学习 编辑:程序博客网 时间:2024/06/10 19:59
supportedInterfaceOrientations设备支持方向
- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;}preferredInterfaceOrientationForPresentation 方法提供的择优的方向取向
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationLandscapeLeft;}
ios5
重写 shouldAutorotateToInterfaceOrientation: 方法和指示您的视图支持哪个方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation{ if ((orientation == UIInterfaceOrientationPortrait) || (orientation == UIInterfaceOrientationLandscapeLeft)) return YES; return NO;}监听屏幕方向变化
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
//处理旋转之后的操作
- (void)orientationChanged:(NSNotification *)notification
- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;}preferredInterfaceOrientationForPresentation 方法提供的择优的方向取向
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationLandscapeLeft;}
ios5
重写 shouldAutorotateToInterfaceOrientation: 方法和指示您的视图支持哪个方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation{ if ((orientation == UIInterfaceOrientationPortrait) || (orientation == UIInterfaceOrientationLandscapeLeft)) return YES; return NO;}监听屏幕方向变化
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
//处理旋转之后的操作
- (void)orientationChanged:(NSNotification *)notification
0 0
- iOS屏幕旋转相关
- IOS 屏幕旋转相关问题
- IOS 设备屏幕旋转相关收集
- iOS屏幕横竖屏旋转相关
- 屏幕旋转相关说明
- iOS手动旋转屏幕、自动旋转屏幕
- ios屏幕旋转注意事项
- iOS强制旋转屏幕
- ios 锁定 屏幕旋转
- ios旋转屏幕总结
- [IOS] 屏幕旋转控制
- iOS屏幕旋转
- 手动旋转iOS屏幕
- iOS屏幕旋转
- ios屏幕旋转
- iOS屏幕旋转
- IOS屏幕旋转
- iOS 屏幕旋转
- 线性动态规划——专题
- iOS开发UI篇—UIPickerView控件简单介绍
- 三次握手,四次挥手『学习笔记』
- MongoDB整合Spring 详细讲解(含代码)
- poj3080
- iOS屏幕旋转相关
- Scala语言 中的 apply 和 update 方法的使用
- telnet协商过程--转载自arthurscfd的《telnet协商》
- Express中method-override模块详解(一): 使用
- iOS - 正则表达式判断邮箱、身份证..是否正确
- maven之profile
- ArcMap——浏览地图
- 线性表实验
- 通过函数申请内存的两个函数剖析(malloc函数讲解)