如何修正iOS6上Oritentation的问题
来源:互联网 发布:php去除html标签 css 编辑:程序博客网 时间:2024/04/28 01:33
1.将addSubview修改为setRootViewController
[window addSubview: viewController.view];修改如下:
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// warning: addSubView doesn't work on iOS6
[window addSubview: viewController.view];
}
else
{
// use this mehod on ios6
[window setRootViewController:viewController];
}
2.修改shouldAutorotateToInterfaceOrientation
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
iOS6以前会呼叫这方法来判断手机是垂直或打横
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead of shouldAutorotateToInterfaceOrientation
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL) shouldAutorotate {
return YES;
}
iOS6需在加上上面方法
- 如何修正iOS6上Oritentation的问题
- 如何修正iOS6上Oritentation的问题
- 如何同时支持IOS5和IOS6上的屏幕旋转?
- 如何同时支持IOS5和IOS6上的屏幕旋转?
- 如何让ios7的app同时适应ios6,即ios6与ios7的适配问题
- 合唱队问题的修正
- ios6, ios7上文字长度计算问题, 可变长文字的自动适配显示
- xcode5上运行iOS6的模拟器
- 修正TiAnlogDisplay显示的问题
- Qt5出现汉字乱码问题如何修正
- 苹果为iPhone4S用户的3G连接提供了iOS6.1.1的修正补丁
- 修正jquery-weui对话框在IOS上的弹出起始位置的问题
- 修正CGBitmapContextCreate iOS8上的错误
- iOS6中图片加载的问题
- iOS6中图片加载的问题
- ios6下画面旋转的问题
- ios6下画面旋转的问题
- ios6下画面旋转的问题
- 基于RFID无线射频的设备管理系统---简介
- 奶茶MM罕见体操美照
- ReadDOS_head_Mapping
- iOS6对于shouldAutorotateToInterfaceOrientation的改动以及其他一些窗口相关细节
- UCOS_II学习笔记---任务管理之任务切换
- 如何修正iOS6上Oritentation的问题
- ARX CAD HW10_1
- ARX CAD HW10_2
- 程序研发之舌战风云(续二)
- 杂记之C语言之函数scanf的使用
- cocos2d-x-使用fopen函数读取assets里的内容导致crash
- 创建并运用客户化jsp标签
- java解析json的类
- 读书笔记《30天自制操作系统》day09