【问题标题】:UILabels don't look good in the landcsape modeUILabel 在横向模式下看起来不太好
【发布时间】:2010-09-07 23:50:57
【问题描述】:

我正在编写横向模式的游戏。在 *.plist 中,我将“初始界面方向”选项设置为“横向(左主页按钮)”。在 Interface Builder 中,我的表单看起来不错,左侧和底部有 2 个标签。 但是当我在模拟器或 iphone 中启动应用程序时,如下所示

http://www.glowfoto.com/static_image/07-102041L/8907/png/09/2010/img4/glowfoto

标签位于顶部并旋转。任何人都知道我做错了什么以及如何解决这个问题?

【问题讨论】:

    标签: iphone


    【解决方案1】:

    我认为您的视图控制器的 shouldAutorotateToOrientation 方法不会将 YES 返回到横向,而是返回到纵向。但如果没有代码,这只是一种猜测。

    【讨论】:

    • 谢谢,它有效。我已将代码添加到我的 UIViewController 类中 -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return interfaceOrientation == UIInterfaceOrientationLandscapeLeft; }
    • 为了让你的应用二启动更好,还允许 UIInterfaceOrientationLandscapeRight。强迫用户只使用其中一个真的很烦人。 ;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-20
    相关资源
    最近更新 更多