只在某页面屏幕旋转,其他竖屏
来源:互联网 发布:数据港 编辑:程序博客网 时间:2024/06/11 00:43
从根视图一层一层返回,直到最上层,从最上层设置是否支持.
当初 电影时光 一直想加进去,在视频播放时横屏,其他竖屏. 现在是会了. 真机测试的时候一定要把设置里的屏幕锁定去掉.
UITabBarController中设置
- (BOOL)shouldAutorotate
{
return [self.selectedViewController shouldAutorotate];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return [self.selectedViewController supportedInterfaceOrientations];
}
UINavigationController中设置
- (BOOL)shouldAutorotate
{
return [self.topViewController shouldAutorotate];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
某个页面如果不支持
- (BOOL)shouldAutorotate
{
return NO;
}
某个页面如果支持
- (BOOL)shouldAutorotate
{
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
/**
刚进入时的方向
*/
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationMaskAll; // 全屏幕
return UIInterfaceOrientationMaskPortrait ;//正向
}
/**
屏幕旋转的调用函数
*/
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
}
//获取当前 状态栏的方向
[[UIApplicationsharedApplication] statusBarOrientation]
- 只在某页面屏幕旋转,其他竖屏
- iOS指定页面屏幕旋转,手动旋转(iOS 屏幕旋转只在当前控制器生效)
- 只在特定的页面支持屏幕旋转
- MMDrawerControlle只在一级页面有侧滑,其他页面没有,只需在一级页面这么操作即可
- iOS单独页面屏幕旋转
- iOS指定页面屏幕旋转
- iOS指定页面屏幕旋转
- iOS指定页面屏幕旋转,手动旋转
- iOS如何指定某个页面可以旋转屏幕,其余控制器都正常竖屏
- 里脊串大神 --- 在开发过程中,有的页面需要横屏,有的不需要, 所以本文带来强制旋转屏幕
- iOS指定页面屏幕旋转,手动旋转(某app实现功能全过程)
- ios7禁止屏幕旋转,强制竖屏
- IONIC 竖屏显示(屏幕不旋转)
- iOS 指定部分页面可屏幕旋转
- Robotframework执行脚本时,ie11只在当前页面为登陆,链接到其他页面时,还是未登录状态。
- ios某一个屏幕支持旋转,其他不支持的方法
- 在WinCE中实现屏幕旋转
- android屏幕旋转在framework中的修改。
- Unity插件 - MeshEditor(七)变形动画骨骼及蒙皮
- iOS开发之<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0”/>
- 树形结构的数据库表Schema设计
- 解决maven项目自动修改jdk版本问题
- 图像识别常用的数据库
- 只在某页面屏幕旋转,其他竖屏
- 文章标题
- Java 线程 synchronized 学习
- AES 代码实现
- UE4 三维点击事件
- 程序员提升效率的工具
- Swift 数值运算符
- VS2015使用小技巧 同时调试两个控制台程序
- cm12 for 三星n7100编译