0

我试图让我的应用程序更新以使用新的iPhone 5,并且我的某些视图将键盘从视图的顶部而不是底部放下。下面是一个图像更好地说明:键盘在UIViewController中颠倒

enter image description here

此的iOS 6.0之前的工作,所以我猜它一定有什么新的API中,是造成这个错误的光芒。我正在使用以下代码来支持UIVeiwController中的方向:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
      interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

- (BOOL)shouldAutorotate { 
    return YES; 
} 

- (NSUInteger)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskLandscape; 
} 

是否有其他人看到类似的问题?谢谢!

+0

它是在一个自定义的视图/窗口中,并且转换已经被应用? –

回答

0

我在question找到了答案。我的问题是通过更改一行代码来设置我的根用户界面视图控制器。

更改该行:

[window addSubview:viewController.view]; 

这样:

[window setRootViewController:viewController]; 
0

我试图复制您的问题,但它适用于iOS6上的我。我的建议可能不是很有帮助,但请查看代表,综合和所有功能的匹配。

0

安德鲁,我还发现,该方法shouldAutoROtateToInterfaceOrientation在iOS的弃用6

不管怎么说,我看见你解决你的问题。