如何仅为一个UIView支持横向/纵向方向 [英] how to support landscape/Portrait orientation only for one UIView

查看:77
本文介绍了如何仅为一个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

http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/shouldAutorotateToInterfaceOrientation

这篇关于如何仅为一个UIView支持横向/纵向方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆