Xcode 强制启用应用程序轮换
我正在开发一个基于 iPad/iPhone 标签栏的应用程序。我有大约 30 个类文件,需要在应用程序中启用旋转,以便 iPad 用户可以在任何方向查看。据我所知,每个类都需要使用以下命令来启用旋转:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return YES;
}
但是,我在单个类文件中创建并完全显示了一些 UIViewControllers
,据我所知,您无法启用它适用于该类型。 有没有办法为应用程序启用全局轮换?我在Info.plist中尝试过。是否可以将某些内容添加到 AppDelegate 中以启用全局轮换? 顺便说一句:我已经尝试在每个类文件中添加返回 YES
进行轮换。 提前致谢, 巴哈里尼
I am working on an iPad/iPhone tab-bar based application. I have about 30 class files and need to enable rotation in the app, so that iPad users can view at any orientation. As far as I know, every class needs rotation to be enabled by using the following:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return YES;
}
However, I have some UIViewControllers
created and displayed completely in a single class file, and as far as I know you cannot enable it for that type.
Is there a way I can enable global rotation for the app? I have tried in Info.plist. is there something that can be added to the AppDelegate
to enable global rotation?
Btw: I have already tried adding returning YES
for rotation in every class file.
Thanks in advance,
Baharini
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
Xcode
的Project Navigator
中单击项目名称。现在,在Summary
选项卡的中心视图上,您可以看到iPad\iPhone Development Info
,这部分有Supported Device Orientations
。您可以将它们全部设置为支持任何方向!我希望它对你有用!
In
Xcode
on theProject Navigator
click on the project name. Now on center view on theSummary
tab, you can see theiPad\iPhone Development Info
in this part there isSupported Device Orientations
. You can set all of them for supporting any orientation!I hope it be useful for you!