TabBarController 不自动旋转
从我的模态视图控制器中,您可以在两个选项之间进行选择,然后每个选项都会显示一个 tabBar 等等。我的模态视图显然会自动旋转,但 tabBar 不会,即使我为项目中的每个 UIViewController 设置:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
我什至有一个带有 tabBar 的新视图,应该在横向模式下调用,但不幸的是它仍然处于肖像模式:
对我来说看起来很奇怪。
From my modal view controller, you can choose between two options, then each one shows a tabBar and so on. My Modal view clearly auto rotates, but the tabBars do not, even though I set for every UIViewController in my Project:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
I even had a new view with tabBar that was supposed to be called when in Landscape mode, but unfortunately it is still in Potrait:
Looks weird to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 iOS 中,只有所有视图都一致时视图才会旋转。
确保您的
UITabBarController
也同意,其他选项卡也同意。In iOS, the view will only rotate if all views agree.
Make sure that your
UITabBarController
also agrees, and the other tabs as well.