Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
watchkit 中的 Images.xcassets 有 1x、2x 和 3x 选项。
但是我们怎么知道使用哪一个呢?两者都是视网膜,但屏幕尺寸不同。我们必须提供所有三个吗?如果你不这样做会发生什么?
编辑:我尝试将图像放在 1x 和 2x 中,到目前为止还没有注意到任何差异,但这可能只是我没有进行测试。没有其他的。
他们都是@2x。您可以xcassets通过指定设备将图像集配置为实际特定于 Apple Watch。下面是演示如何执行此操作的屏幕截图。
@2x
xcassets
希望这有助于澄清事情。
它将使用最接近的可用匹配。但是手表是视网膜原生的,所以理想情况下你只需提供@2x;捆绑更多只会占用不需要的空间。