菜鸟教程小白 发表于 2022-12-13 02:28:48

ios - 文件名后缀 iPad 图像到 Assets 目录


                                            <p><p>Xcode Asset Catalogs 有一个非常方便的功能,其中拖动文件命名如下:</p>

<pre><code>image.png
[email protected]
[email protected]
</code></pre>

<p>将创建一个名为 <code>image</code> 的单个 <em>图像集</em>,每个图像都放置在正确的插槽中。</p>

<p><strong>是否有适用于 iPad 图像的后缀?</strong>我正在寻找一种有效的方法来将 ipad 图像添加到与他们的 iPhone 兄弟在同一图像集中的 Assets 目录中。</p>

基本名称后的 <p><code>~ipad</code> 和 <code>~iphone</code> 似乎只适用于 XIB 文件。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>是的,从iOS4开始你可以使用<code>~ipad</code>和<code>~iphone</code>,格式如下:</p>

<p><em><basename><device>.<filename_extension></em></p>

<p>来自 <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html" rel="noreferrer noopener nofollow">the documentation</a> :</p>

<blockquote>
<p>Thestring represents the original name of the resource file. It also represents the name you use when accessing the file from your code. Similarly, thestring is the standard filename extension used to identify the type of the file. Thestring is a case-sensitive string that can be one of the following values:</p>

<ul>
<li><p><code>~ipad</code> - The resource should be loaded on iPad devices only.</p></li>
<li><p><code>~iphone</code> - The resource should be loaded on iPhone or iPod touch devices only.</p></li>
</ul>
</blockquote></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 文件名后缀 iPad 图像到 Assets 目录,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/26226576/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/26226576/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 文件名后缀 iPad 图像到 Assets 目录