【问题标题】:universal xcode 3.2.6 Landscape mode by default通用 xcode 3.2.6 默认横向模式
【发布时间】:2012-04-05 16:00:49
【问题描述】:

我如何在默认情况下在横向模式下使用 xcode 3.2.6 创建通用应用程序?我需要为每个视图单独的 .xib 文件,我必须使用此代码吗 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {// 对于支持的方向返回 YES 返回(界面方向== UIInterfaceOrientationLandscape); }

【问题讨论】:

    标签: objective-c xcode3.2 ios-universal-app


    【解决方案1】:

    在您的 plist 中,您应该将 supported interface orientations 更改为两个项目:

    项目 0 Landscape (right home button)

    项目 1 Landscape (left home button)

    并在每个视图控制器中使用:

      - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
       // Return YES for supported orientations
       return (UIInterfaceOrientationIsLandscape(interfaceOrientation));
    }
    

    【讨论】:

      【解决方案2】:

      我使用此示例代码并使其基于视图,我只是使用此代码隐藏其导航栏 self.navigationController.navigationBarHidden = YES; 在 RootViewController_Phone.h 和 RootViewController_Pad BenellingsonPost

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-25
        • 1970-01-01
        • 1970-01-01
        • 2014-03-27
        • 2012-05-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多