IOS 6屏幕旋转不使用情节提要

2023-05-19移动开发问题
4

本文介绍了IOS 6屏幕旋转不使用情节提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

任何尝试最新 iOS 6 测试版(版本 2 或 3)的人都有相同的自动旋转不起作用的经历?

Anyone who's trying the newest iOS 6 beta(version 2 or 3) has the same experience of auto rotation not working?

我没有使用故事板,而是纯粹的导航控制:

I am not using storyboard but pure navigation control:

self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];

还有:

- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
    return YES;
}
}

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}

但是 IOS 根本没有支持,在 3GS/4S 和 4.3,5.0.5.1 模拟器上与所有以前的 iOS 都可以正常工作,但 iOS 6 似乎只是错误

BUT IOS has no espouse at all, works fine with all previous iOS on 3GS/4S and 4.3,5.0.5.1 simulator, but iOS 6 seems just buggy

推荐答案

解决方案是:由于我的应用试图从 4.3+ 开始支持,因此我必须使用导航控制器来进行每个视图切换.

The solution is that: Since my app is trying to support from 4.3+, I have to use the navigation controller to do every view switch.

通过 ios6 似乎代表导航控制器,我必须定义自己的导航控制器,并设置条件和函数来更改其旋转行为.

by ios6 seems delegates to the navigation controller, I have to define my own navigation controller, and setup conditions and functions to change its rotation behaviour.

当我加载视图时,我会执行 ([self.navigationCONtroller setEnableLandscape:(BOOL)false]).这样你就拥有了导航控制器的完整控制器.

When I load a view, I then do([self.navigationCOntroller setEnableLandscape:(BOOL)false]). in that way you have full controller of your navigation controller.

注意:我确实尝试过覆盖导航控制器方法,但似乎只是被忽略了.(这只发生在 ios 6.0 上),还没有测试 6.1,所以不确定它是否得到修复(如果有,请告诉我)

NOTE: I did try override the navigation controller methods, but seems just get ignored. (This only happens to ios 6.0 as well), haven't test 6.1 yet, so not sure if it's get fixed(which please let me know if it does)

这篇关于IOS 6屏幕旋转不使用情节提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7