【问题标题】:How to change the orientation of the interface through code in iPad如何在 iPad 中通过代码更改界面的方向
【发布时间】:2011-07-20 10:06:16
【问题描述】:

你好 我想知道是否可以通过 iPhone/iPad 中的代码更改界面的方向。例如,我有一个按钮。如果我单击该按钮,我的界面方向应该会改变。如果可能,请帮助我如何做。

【问题讨论】:

    标签: iphone orientation


    【解决方案1】:

    请通过这个

    Is there a documented way to set the iPhone orientation?

    UIDevice 上有一个未记录的属性设置器可以解决问题,但显然会生成编译器警告,并且可能会在 SDK 的未来版本中消失。

    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
    

    另一个链接Forcing UIInterfaceOrientation changes on iPhone可能对你有帮助

    【讨论】:

    • 这些是直接导致拒绝的编译器警告。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-27
    • 1970-01-01
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多