关于ios横竖屏显示不正常的一个Bug修复
来源:互联网 发布:莫干黄芽茶 淘宝 编辑:程序博客网 时间:2024/05/19 00:14
修改一个旧项目的时候,设置iphone是竖屏、ipad横屏显示,
1.修改了这里
2 ipad设置了这
#pragma mark ———— ipad
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation ==UIInterfaceOrientationLandscapeLeft || interfaceOrientation ==UIInterfaceOrientationLandscapeRight);//UIInterfaceOrientationPortrait
}
- (NSUInteger)supportedInterfaceOrientations {
NSLog(@"让我旋转哪些方向");
returnUIInterfaceOrientationMaskLandscape;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
if (fromInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[AppVars standardVars].InterfaceOrientation=@"left";
}else {
if (fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[AppVars standardVars].InterfaceOrientation =@"right";
}
}
}
屁作用不起!
最后原因是
rootViewController = [[RootViewControlleralloc] initWithNibName:nilbundle:nil];
navigation = [[UINavigationControlleralloc]initWithRootViewController:rootViewController];
// [self.window addSubview:navigation.view]; //旧版
self.window.rootViewController =navigation; // 改成 这样 OK 搞定
这个addSubview: 坑了好几次了 这次记下啦
- 关于ios横竖屏显示不正常的一个Bug修复
- 关于iOS网络请求tabbart图片显示不正常的问题
- 关于bootstrap datetimepicker位置显示错误的bug修复
- 网页显示不正常怎么修复
- 一个nullPointer bug的修复
- TortoiseGit状态图标不正常或不显示的问题修复
- 淘宝网页白底蓝字显示不正常的修复办法
- Android横竖屏切换布局不正常的问题
- Android横竖屏切换布局不正常的问题
- 关于Webbrowser针对网银控件显示不正常的一个解决思路。
- 关于dedeCMS v5.7后台设置友情链接图片无法正常显示的bug修复
- iOS开发关于某页面横竖屏切换的坑
- [ios] 模拟器图标 玻璃化 bug的修复
- Reflector.FileDisassembler的一个bug修复
- 一个多线程示例程序的BUG修复
- 修复Git打包的一个Bug
- Cascade_Master的一个小bug修复
- pomelo 框架一个session bug的修复
- Java 构造函数的“继承”
- Android UI一致性
- qq 传输文件 ,为啥不经过qq协议 走了http呢?
- Activity之间传递类对象(Parcelable)
- LVS-DR工作原理图文详解
- 关于ios横竖屏显示不正常的一个Bug修复
- APUE学习笔记——11 线程同步、互斥锁、自旋锁、条件变量
- const 指针与指向const的指针
- jquery easyui dialog问题
- Linux套接字编程
- Matlab做PCA分析
- 《LoadRunner 没有告诉你的》和《JMeter从入门到精通》
- Linux监控系统CPU、内存、磁盘空间和网口收发脚本
- First Missing Positive