处理选项卡控制器时仅以特定方式旋转某些视图
我有一个带有许多 (4) 个不同视图的选项卡栏控制器。我希望能够仅将我的一个视图旋转到 landScapeRight 或 LandscapeLeft (因此没有纵向或颠倒)。其他的只能是纵向或倒置。我在某处读到,对于选项卡控制器,所有子视图都需要在方法 shouldAutoRotateToInterfaceOrientation 中返回 YES:我已经完成了此操作并且一切正常,但我似乎只能在全有或全无的情况下得到它,这意味着它们要么全部执行所有旋转或根本不旋转。 如果有人对如何解决这个问题有任何想法或建议,我们将不胜感激。
先感谢您!
I have a tab bar controller with many (4) different views. I want to be able to rotate only one of my views to landScapeRight or LandscapeLeft (so no portrait or upside down). The others should only be portrait or upside down. I read somewhere that for tab controllers, all subviews needed to return YES in the method shouldAutoRotateToInterfaceOrientation: I have done this and everything works but I can only seem to get it in an all-or-nothing situation, meaning its either all of them do all the rotations or none rotate at all.
If anyone has any ideas or suggestions on how to tackle this problem, it would be much appreciated.
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑(我误读了你的问题):我认为你不能独立旋转子视图。
Edit (I had misread your question): I don't think you can rotate subviews independently.
我假设您正在使用 UITabBarController 的子类来获取自动旋转行为。如果您想获得独立的旋转行为,则必须采用仿射变换路线。这有点痛苦,但可行。
I assume that you are using a subclass of UITabBarController to get the autorotation behavior. If you want to get independent rotation behavior, you'll have to go the affine transform route. It's kind of a pain, but doable.