Iphone UIViewController中的键盘是颠倒的
我正在尝试更新我的应用程序,以便与新的iPhone5配合使用,我的一些视图将键盘从视图的顶部而不是底部放下。以下是一张更好地说明的图片: 这在iOS 6.0之前就已经生效了,所以我猜这一定是新API中的某些东西导致了这个bug的出现。我使用以下代码支持UIVeiwController中的方向:Iphone UIViewController中的键盘是颠倒的,iphone,objective-c,uiviewcontroller,ios6,uiinterfaceorientation,Iphone,Objective C,Uiviewcontroller,Ios6,Uiinterfaceorientation,我正在尝试更新我的应用程序,以便与新的iPhone5配合使用,我的一些视图将键盘从视图的顶部而不是底部放下。以下是一张更好地说明的图片: 这在iOS 6.0之前就已经生效了,所以我猜这一定是新API中的某些东西导致了这个bug的出现。我使用以下代码支持UIVeiwController中的方向: -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Re
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
还有谁见过类似的问题吗?谢谢 我试图复制您的问题,但它在iOS6上对我很有用。我的建议可能没有多大帮助,但请检查学员、综合和所有功能是否匹配 我在这里找到了答案。通过更改设置根UI视图控制器的一行代码,解决了我的问题 更改此行:
[window addSubview:viewController.view];
为此:
[window setRootViewController:viewController];
Andrew,我还发现该方法shouldAutoROtateToInterfaceOrientation在iOS 6中被弃用
无论如何,我看到您解决了问题。是否在自定义视图/窗口中,并且已应用转换?