横.竖屏旋转方法
来源:互联网 发布:php while break 编辑:程序博客网 时间:2024/05/18 02:39
//********************下面方法是ios8以后的横竖屏旋转方法-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{ //横竖屏下size大小不同.可以用来判断横竖屏状态,也可以根据状态栏方向来判断横竖屏 NSLog(@" size= %@", NSStringFromCGSize(size)); NSLog(@" size11= %@", coordinator); [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { NSLog(@"context = %@",context);// 官方提供了一个办法就是查看当前电池条的状态 UIInterfaceOrientationorientation = [UIApplicationsharedApplication].statusBarOrientation;通过这个办法,你可以知道当前屏幕的电 池条的显示方向, UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) { NSLog(@"VC横屏"); }else{ NSLog(@"VC竖屏"); } } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { NSLog(@"完成旋转"); }];}
0 0
- 横.竖屏旋转方法
- 旋转方法
- Android WebView在屏幕旋转后,不重新加载URL及禁止横屏的方法
- Android WebView在屏幕旋转后,不重新加载URL及禁止横屏的方法
- ios 禁用旋转横屏
- android支持横屏旋转
- ios6以后旋转方法
- 各种旋转表示方法
- swift:旋转动画方法
- 旋转表示方法
- iOS 图片旋转方法
- iOS 图片旋转方法
- iOS 图片旋转方法
- iOS 图片旋转方法
- Unity--旋转方法
- 旋转的表示方法
- iphone 旋转横屏与竖屏切换view
- android中 禁止竖屏,且横屏可以旋转
- System.currentTimeMillis()与SystemClock.uptimeMillis()
- 市场调查与分析概述2
- HDU 2082 找单词
- kaldi monophone training outline
- OpenDayLight+Mininet测试环境搭建
- 横.竖屏旋转方法
- leetcode -- Minimum Height Trees -- 关于graph的,重点
- eclipse jetty插件的安装
- Android启动页面的正确打开方式
- ORACLE11g R2 DG FOR OEL7.1 安装实施
- ios 第二课 类的初始化
- ios中的手势
- 最好的Python机器学习库
- C语言预处理及特殊函数介绍(extern/exit/atexit/volatile/static/calloc/realloc等)PART ONE