菜鸟教程小白 发表于 2022-12-12 19:36:48

ios - iPad 3 上更高 dpi 的屏幕对 Assets 有何影响?


                                            <p><p>显然 Apple 刚刚发布了 <a href="http://www.apple.com/ipad/" rel="noreferrer noopener nofollow">new iPad</a> .就开发人员而言,添加新 Assets 以支持 iPad 型号的视网膜和非视网膜显示器有何影响?和 iPhone 4 和 4S 上实现的@2x 模型一样吗?</p>

<p>如果我有 foo.png,我会将它的不同大小版本命名为什么名称,以便它可以在所有 iOS 设备上的通用应用程序中工作? </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这可能会通过按照您所说的方式解决,<code>@2x</code> 但使用设备修饰符,因为它们使像素数增加了一倍。你可能会写 <code>myimage@2x~ipad.png</code>.</p>

<blockquote>
<p>Applications running in iOS 4 should now include two separate files
for each image resource. One file provides a standard-resolution
version of a given image, and the second provides a high-resolution
version of the same image. The naming conventions for each pair of
image files is as follows:</p>
</blockquote>

<pre><code>Standard: &lt;ImageName&gt;&lt;device_modifier&gt;.&lt;filename_extension&gt;
High resolution: &lt;ImageName&gt;@2x&lt;device_modifier&gt;.&lt;filename_extension&gt;
</code></pre>

<blockquote>
<p>The <code>&lt;ImageName&gt;</code> and <code>&lt;filename_extension&gt;</code> portions of each name
specify the usual name and extension for the file. The
<code>&lt;device_modifier&gt;</code> portion is optional and contains either the string
<code>~ipad</code> or <code>~iphone</code>. You include one of these modifiers when you want to
specify different versions of an image for iPad and iPhone. The
inclusion of the <code>@2x</code> modifier for the high-resolution image is new and
lets the system know that the image is the high-resolution variant of
the standard image.</p>
</blockquote>

<p> <a href="https://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html" rel="noreferrer noopener nofollow">https://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - iPad 3 上更高 dpi 的屏幕对 Assets 有何影响?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/9609315/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/9609315/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - iPad 3 上更高 dpi 的屏幕对 Assets 有何影响?