菜鸟教程小白 发表于 2022-12-11 19:45:54

ios - 启动屏幕无法正常工作


                                            <p><p>我的应用程序同时支持横向和纵向方向,在这里我使用启动屏幕作为启动屏幕,然后拖动 uiimageview 和 pined trail、lead、bottom、top...添加所需的所有尺寸是多少?我应该使用图像 Assets 吗?我必须创建两个不同的图像吗?我通过使用 size 类为 iPhone 和 iPad 使用两个不同的图像,当 iPad 在横向模式下运行时它会拉伸(stretch)。</p>

<p>我指的是 <a href="https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/" rel="noreferrer noopener nofollow">https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/</a> </p>

<p>这里如何设置横向和纵向的图像和尺寸?</p>

<p>我们知道如何通过 Assets 目录使用启动图像。</p>

<p>由于 iPhoneX 设计崩溃,很多人建议我们使用启动屏幕 Storyboard,然后 iPhoneX 问题就消失了..</p>

<p>提前谢谢...</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这里有一份很好的 Apple 文档来回答您的问题:<a href="https://developer.apple.com/library/content/technotes/tn2244/_index.html" rel="noreferrer noopener nofollow">Launching your iPhone Application in Landscape</a> </p>

<p><strong>非常简洁,这份文件说</strong>
<br/>为纵向模式或横向模式设置启动图像。根据您对应用程序启动的要求选择启动图像的方向。 <em>如果您的应用支持两种方向,请勿使用静态启动图像</em>。</p>

<p><br/>
<strong>启动图片</strong>
<br/>iPhone 应用程序的启动图像的大小始终与纵向屏幕的尺寸相匹配。对于以横向启动的应用程序,您应该使用首选的图形编辑软件来旋转启动图像的内容,同时保持图像的大小与纵向启动图像一致(高度 > 宽度)。</p>

<p><strong>避免使用 Assets 目录来管理横向应用程序的启动图像</strong>。
<br/>除了 iPhone 6 Plus 使用的启动图像, Assets 目录假定所有 iPhone 启动图像都是纵向的。编译应用程序时,每个启动图像的条目都将添加到 UILaunchImages 键下的已编译信息属性列表中。每个条目中的 UILaunchImageOrientation 键的值始终是 Portrait。然后在启动时忽略这些条目,因为 UILaunchImageOrientation 键的 Portrait 值与启动方向(横向左或横向右)不匹配。结果是在启动过程中出现空白屏幕,因为系统找不到合适的启动图像。</p>

<p>相反,如果您的应用程序仅支持 iOS 8 及更高版本,则应使用启动文件。否则,您需要将启动图像作为资源添加到项目中,然后将 UILaunchImages 键添加到应用程序的信息属性列表中。请务必禁用 Assets 目录来管理启动图像,方法是从应用程序目标的项目编辑器的常规选项卡下的启动图像源菜单中选择“不使用 Assets 目录”。</p>

<p>最好为启动屏幕使用 XcodeStoryboard,但如有必要,您可以提供一组静态图像。为不同的设备创建不同尺寸的静态图片,并确保包含状态栏区域。</p>

<h1> <a href="https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/" rel="noreferrer noopener nofollow">Static Launch Screen Images</a> </h1>

<p>这是两个方向的静态启动屏幕图像的尺寸表:</p>

<p> <img src="/image/PHlwY.png" alt="enter image description here"/> </p>

<p><strong>如何设置横向静态图片?</strong></p>

<p>启用 <code>Landscape</code> 从您的图像 Assets 启动屏幕图像支持</p>

<blockquote>
<blockquote>
    <p>(Image) Assets.xcassets &gt;&gt; Launch Image &gt;&gt; Attribute Inspector &gt;&gt; Enable Landscape (tickmark) &gt;&gt; Set Landscape images</p>
</blockquote>
</blockquote>

<p> <img src="/image/nrwen.png" alt="enter image description here"/> </p>

<p>这里有一个很好的教程:<a href="https://docs.nativescript.org/publishing/creating-launch-screens-ios" rel="noreferrer noopener nofollow">Customizing LaunchScreen.storyboard</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 启动屏幕无法正常工作,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/48863262/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/48863262/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 启动屏幕无法正常工作