【发布时间】:2012-11-16 18:08:05
【问题描述】:
我正在尝试更新我的应用程序以与新的 iPhone 5 一起使用,我的一些视图将键盘从视图顶部而不是底部放下。这里有一张图片可以更好地说明:
这在 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;
}
有没有其他人遇到过类似的问题?谢谢!
【问题讨论】:
-
是否在自定义视图/窗口中并应用了转换?
标签: iphone objective-c uiviewcontroller ios6 uiinterfaceorientation