• <legend id='Ww1UC'><style id='Ww1UC'><dir id='Ww1UC'><q id='Ww1UC'></q></dir></style></legend>

      <i id='Ww1UC'><tr id='Ww1UC'><dt id='Ww1UC'><q id='Ww1UC'><span id='Ww1UC'><b id='Ww1UC'><form id='Ww1UC'><ins id='Ww1UC'></ins><ul id='Ww1UC'></ul><sub id='Ww1UC'></sub></form><legend id='Ww1UC'></legend><bdo id='Ww1UC'><pre id='Ww1UC'><center id='Ww1UC'></center></pre></bdo></b><th id='Ww1UC'></th></span></q></dt></tr></i><div id='Ww1UC'><tfoot id='Ww1UC'></tfoot><dl id='Ww1UC'><fieldset id='Ww1UC'></fieldset></dl></div>
      <tfoot id='Ww1UC'></tfoot>
        <bdo id='Ww1UC'></bdo><ul id='Ww1UC'></ul>

        <small id='Ww1UC'></small><noframes id='Ww1UC'>

      1. 强制 iOS 应用以横向模式启动

        时间:2023-06-01
          <bdo id='ihKTM'></bdo><ul id='ihKTM'></ul>
          <tfoot id='ihKTM'></tfoot>

              <tbody id='ihKTM'></tbody>

              • <small id='ihKTM'></small><noframes id='ihKTM'>

                <legend id='ihKTM'><style id='ihKTM'><dir id='ihKTM'><q id='ihKTM'></q></dir></style></legend>
                <i id='ihKTM'><tr id='ihKTM'><dt id='ihKTM'><q id='ihKTM'><span id='ihKTM'><b id='ihKTM'><form id='ihKTM'><ins id='ihKTM'></ins><ul id='ihKTM'></ul><sub id='ihKTM'></sub></form><legend id='ihKTM'></legend><bdo id='ihKTM'><pre id='ihKTM'><center id='ihKTM'></center></pre></bdo></b><th id='ihKTM'></th></span></q></dt></tr></i><div id='ihKTM'><tfoot id='ihKTM'></tfoot><dl id='ihKTM'><fieldset id='ihKTM'></fieldset></dl></div>

                  本文介绍了强制 iOS 应用以横向模式启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在为 iOS 5 开发一个应用程序,它必须在横向模式下运行.我的问题是我最初无法让它翻转.

                  I am developing an app for iOS 5, which have to run in landscape mode. My problem is that I cannot get it to flip initially.

                  我已经尝试将初始界面方向"设置为横向(右主页按钮)"并将以下方法添加到我的视图控制器:

                  I have tried the adding "Initial interface orientation" set to "Landscape (right home button)" and adding the following method to my view controller:

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

                  我可以理解它应该如何工作.(我找到了代码 这里)

                  I can wrap my head around how it is supposed to work. (I found the code here)

                  我也想知道如何使用 Xcode 4.2 项目设置中提供的支持的设备方向",它似乎没有做任何事情.

                  I am also wondering how to use the "Supported Device Orientation" available in the Xcode 4.2 project setup, it does not seem to do anything.

                  我一直在浏览网站,但找不到解决我问题的示例.

                  I have been looking around the website and have not been able to find an example that solves my problem.

                  谢谢.

                  推荐答案

                  在应用程序的 Info.plist 文件中,添加 UIInterfaceOrientation键并将其值设置为横向模式.景观方向,您可以设置值这把钥匙UIInterfaceOrientationLandscapeLeft或者UIInterfaceOrientationLandscapeRight.

                  In your application’s Info.plist file, add the UIInterfaceOrientation key and set its value to the landscape mode. For landscape orientations, you can set the value of this key to UIInterfaceOrientationLandscapeLeft or UIInterfaceOrientationLandscapeRight.

                  以横向模式布置视图,并确保其自动调整大小选项设置正确.

                  Lay out your views in landscape mode and make sure that their autoresizing options are set correctly.

                  覆盖您的视图控制器的 shouldAutorotateToInterfaceOrientation: 方法并仅对所需的横向和否用于纵向.

                  Override your view controller’s shouldAutorotateToInterfaceOrientation: method and return YES only for the desired landscape orientation and NO for portrait orientations.

                  这篇关于强制 iOS 应用以横向模式启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将 JSON 数组解析为 NSDictionary 下一篇:从 ACAccountStore 打开 Twitter 设置 (iOS 5.1 TWITTER)

                  相关文章

                  最新文章

                1. <small id='ypc0P'></small><noframes id='ypc0P'>

                  <i id='ypc0P'><tr id='ypc0P'><dt id='ypc0P'><q id='ypc0P'><span id='ypc0P'><b id='ypc0P'><form id='ypc0P'><ins id='ypc0P'></ins><ul id='ypc0P'></ul><sub id='ypc0P'></sub></form><legend id='ypc0P'></legend><bdo id='ypc0P'><pre id='ypc0P'><center id='ypc0P'></center></pre></bdo></b><th id='ypc0P'></th></span></q></dt></tr></i><div id='ypc0P'><tfoot id='ypc0P'></tfoot><dl id='ypc0P'><fieldset id='ypc0P'></fieldset></dl></div>
                  <legend id='ypc0P'><style id='ypc0P'><dir id='ypc0P'><q id='ypc0P'></q></dir></style></legend>

                    <tfoot id='ypc0P'></tfoot>
                      <bdo id='ypc0P'></bdo><ul id='ypc0P'></ul>