【问题标题】:UIPicker View Rotate SupportUIPicker 视图旋转支持
【发布时间】:2013-01-13 06:19:05
【问题描述】:

我有一个支持横向和纵向的通用 iOS 6 应用程序。

我的视图由底部的 UIPickerView 和顶部附近的标签组成。

在 iPad 或 iPad Mini 上,有足够的空间供 UIPickerView 旋转。但是,UIPickerView 会占用 iPhone 上的整个屏幕区域(4 英寸和 3.5 英寸屏幕)。

我确定它没有帮助我在底部有一个标签栏。

我是否可以缩短/缩小我的 UIPickerView 或在此视图中强制仅显示纵向?

【问题讨论】:

    标签: xcode rotation uipickerview


    【解决方案1】:

    您可以通过-[UIViewController supportedInterfaceRotations]-[UIViewController shouldAutorotate] 的组合来强制仅显示纵向。 (这在 iOS 5 及更低版本中略有不同,您必须使用 -[UIViewController shouldAutorotateToInterfaceOrientation:]

    【讨论】:

    • 为 shouldAutoRotate 返回“false”,并为supportedInferfaceOrientations 返回“UIInterfaceOrientationPortrait”。没用:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-25
    • 2017-05-18
    • 2020-11-29
    • 1970-01-01
    • 1970-01-01
    • 2013-01-03
    相关资源
    最近更新 更多