UISplitViewController 景观

发布于 2024-09-27 02:53:37 字数 47 浏览 0 评论 0原文

如何强制我的应用程序以横向模式启动 UISplitViewController?

How can I force my application to launch an UISplitViewController in landscape mode?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沩ん囻菔务 2024-10-04 02:53:37

您可以在 Info.plist 文件中拥有不同的基于设备的设置。

我找到了一个示例,其中讨论了如何以横向模式(取决于设备)启动应用程序,如下所示:

<key>UIInterfaceOrientation</key>   
   <string>UIInterfaceOrientationPortrait</string>    
<key>UIInterfaceOrientation~ipad</key>      
   <string>UIInterfaceOrientationLandscapeLeft</string> 

第一个标签指 iPhone,~iPad 标签指 iPad。不确定这个链接是否对您有帮助,但这(我的意思是 Info.plist 方式)绝对是正确的选择。

希望有帮助。

你好

乔瓦尼

you can have different device-based settings in your Info.plist file.

I found an example where it talked about having the app launching in Landscape mode (depending on device) like this:

<key>UIInterfaceOrientation</key>   
   <string>UIInterfaceOrientationPortrait</string>    
<key>UIInterfaceOrientation~ipad</key>      
   <string>UIInterfaceOrientationLandscapeLeft</string> 

With the first tag refering to iPhone and the ~iPad one refering to iPad. Not sure if this link will help you, but this (I mean the Info.plist way) is definitely the way to go.

Hope it helps.

Ciao

Giovanni

薄荷港 2024-10-04 02:53:37

您可以随时使用此方法。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}

You can always use this method.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
隔岸观火 2024-10-04 02:53:37

这是一个相当老的问题,Apple 自此更新了 XCode 来处理这种特定情况。这些步骤在 XCode 8.2.1 中进行了测试。

在 plist 编辑器中,展开两种外形尺寸支持的接口(电话/触摸是第一个):

在此处输入图像描述

然后,只需根据设备类型删除您不希望支持的图像即可。

This is a pretty old question, and Apple has since updated XCode to handle this specific situation. These steps were tested in XCode 8.2.1.

In the plist editor, expand out the supported interfaces for both form factors (Phone/Touch is the first one):

enter image description here

Then, simply delete the ones you do not wish to support based on device type.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文