gpt4 book ai didi

iphone - iOS 方向

转载 作者:行者123 更新时间:2023-11-29 04:27:32 26 4
gpt4 key购买 nike

我可以在 iOS 中的 UITabBarController 中更改方向吗?我有这样的东西: UITableViewController-> Team Tab -> UINavigationController -> GalleryViewController 我只想允许 GalleryViewController 更改横向方向是 iOS 可能吗?

如果我设置

- (NSUInteger)supportedInterfaceOrientations to UIInterfaceOrientationMaskPortrait 

对于 UITabBarController,我无法更改 GalleryViewController 的方向,它始终是纵向的。

最佳答案

如果我们从 iOS6 中抽象出来并查看 Tab Bar Controllers and View Rotation文章:

Tab bar controllers support a portrait orientation by default and do not rotate to a landscape orientation unless all of the contained view controllers support such an orientation. When a device orientation change occurs, the tab bar controller queries its array of view controllers. If any one of them does not support the orientation, the tab bar controller does not change its orientation.

这意味着标签栏中的所有其他 View Controller 应该支持所需的方向。

关于iphone - iOS 方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12125998/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com