ios6 - iOS6模拟器中的顶部主页按钮纵向不起作用

标签 ios6 xcode4.5

几分钟前我设置了 XCode 4.5 和 iOS6 模拟器。
我的应用支持所有 4 iPhone的方向,
纵向底部和顶部主页按钮,横向左右。

好吧,我把它放到了 .plist 中,因为它是 iOS6 所要求的,而且旧的 shouldRotateTo... 方法仍然在那里返回 YES。

但是在模拟器中,App是不是 旋转到纵向顶部主页按钮。

为什么?这是故意的吗?它会在设备上正常工作吗?

谢谢。

最佳答案

好的,
我现在自己找到了答案。

拥有是不够的

- (BOOL)shouldAutorotate {

    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskAll;
}

在您的 ViewController 中,如果它被插入 UINavigationViewController .UINavigationViewController还得有那些方法。
最好,您可以通过在 UINavigationViewController 上设置一个小类别来做到这一点。 .

这是我的 UINavigationController-Rotation.h :
@interface UINavigationController (Rotation)
@end

和我的 UINavigationController-Rotation.m:
#import "UINavigationController-Rotation.h"

@implementation UINavigationController (Rotation)

#pragma From UINavigationController

- (BOOL)shouldAutorotate {

    BOOL result = self.topViewController.shouldAutorotate;

    return result;
}

- (NSUInteger)supportedInterfaceOrientations {

    NSUInteger result = self.topViewController.supportedInterfaceOrientations;

    return result;
}

#pragma -

@end

谢谢你帮助我!

关于ios6 - iOS6模拟器中的顶部主页按钮纵向不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12503658/

相关文章:

ios - Apple 会接受仅使用 Xcode 5 构建的应用程序吗

iphone - "_OBJC_CLASS_$_GDataOAuthAuthentication",引用自 :

ios - 您可以将 iOS 图标和启动图像放在项目根目录的不同目录中吗?

iphone - iOS 6 上的应用程序 View 向上移动 20 像素

ios - 为什么我的 UITextView 中的文本在我按下回车键之前是透明的?

svn - 如何更新可能安装在多个地方的 svn 命令行工具?

objective-c - 如何正确使用 webkit 委托(delegate)来启动和停止微调器、OS X、OBJ-C

objective-c - 来自 UICollectionView 的按钮的索引路径

iphone - iOS Dev : Why does self. navigationController.navigationBar.frame.size.height 返回零?

iphone - MKReverseGeocoder 已弃用