如何仅为一个UIView支持横向/纵向方向 [英] how to support landscape/Portrait orientation only for one UIView
问题描述
我在基于导航的应用程序中有5个视图控制器,我需要在一个视图中同时支持横向/纵向模式,在视图中显示以下项目
导航栏
带有两个的工具栏按钮
UIImageView在中心。
UILabe位于导航栏下方。
I'm having 5 view controllers in my navigation based application, I need to support both landscape/Portrait mode in only a one view, following items displaying in the view Navigationbar Tool bar with two buttons UIImageView in center. UILabe below the navigaton bar.
任何人都可以帮助我如何支持方向更改仅适用于此视图。
Can any one help me how to support the orientation change to only for this view.
问候,
sam。
推荐答案
您应该在视图控制器中使用 shouldAutorotateToInterfaceOrientation ,并为应支持横向/纵向的视图控制器返回 YES
You should use shouldAutorotateToInterfaceOrientation in your view controller, and return YES for view controllers that should support both Landscape/Portrait
这篇关于如何仅为一个UIView支持横向/纵向方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!