无法旋转视图
我正在使用 Xcode 4.2 开发故事板应用程序。
我正在尝试旋转视图,但它不起作用。我确保该应用程序支持摘要以及“信息”部分中的 4 次旋转。
我有两种受支持的方向:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) { //check if device is iPad
return YES;
}
else
return NO;
}
我
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
在 iPhone 模拟器上尝试过,它不起作用,但对于 iPad,它工作得很好......有什么原因吗?
我正在使用选项卡栏视图控制器,如果这有什么区别的话......
I am using Xcode 4.2 to develop a storyboard application.
I am trying to rotate views but it is not working. I made sure that the app supports the 4 rotations in the summary as well as in the "info" section.
I have two types of supported orientations:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) { //check if device is iPad
return YES;
}
else
return NO;
}
and
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
I tried it on the iPhone simulator and it is not working, but for the iPad it works perfectly fine... any reasons?
I am using a Tab Bar view controller if this makes any difference ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自此文档
因此,请确保标签栏控制器中的所有视图控制器都为
shouldAutorotateToInterfaceOrientation:
返回YES
from this document
so make sure all view controller in your tab bar controller return
YES
forshouldAutorotateToInterfaceOrientation: