Xcode 10中新的Apple Watch“主屏幕”和“外观简短”图像资产尺寸是什么?

时间:2018-09-20 04:17:41

标签: xcode apple-watch xcode10

Series 4的新Apple Watch尺寸分别为40mm和44mm,并且Xcode 10在“主屏幕”和“外观”下为其提供了新的.xcassets图像插槽:

enter image description here

这三种新资产的最佳图像尺寸是什么?

1 个答案:

答案 0 :(得分:2)

以下是所有新尺寸:

主屏幕(应用启动器)

40mm 2x: 88x88像素(44x44逻辑像素)
44mm 2x: 100x100像素(50x50逻辑像素)

近景(快看)

40mm 2x: 196x196像素(98x98逻辑像素)
44mm 2x: 216x216像素(108x108逻辑像素)


我如何获得此信息的?

如果选择图像并打开“属性”检查器(右侧栏上的最后一个图标),您将获得有关图像的一些信息,包括其尺寸:

Information about an image in AppIcon.appiconset

如果您导航到.xcassets文件中的AppIcon.appiconset/Contents.json,则将获得一个适合所有尺寸的备忘单:

[...]

{
  "size" : "44x44",
  "idiom" : "watch",
  "scale" : "2x",
  "role" : "appLauncher",
  "subtype" : "40mm"
},

[...]

{
  "size" : "50x50",
  "idiom" : "watch",
  "scale" : "2x",
  "role" : "appLauncher",
  "subtype" : "44mm"
},

[...]

{
  "size" : "98x98",
  "idiom" : "watch",
  "scale" : "2x",
  "role" : "quickLook",
  "subtype" : "42mm"
},
{
  "size" : "108x108",
  "idiom" : "watch",
  "scale" : "2x",
  "role" : "quickLook",
  "subtype" : "44mm"
},

[...]