如何将应用程序图标包含到我的 Xcode 项目中

alt*_*ser 4 xcode icons screen-readers ios

我在包含新的应用程序图标时遇到问题。我已经做的是以下内容:

我存档并验证了我的应用程序,并得到了分辨率为 120x120 px、152x152 px 和 167x167 px 的图标丢失的信息。所以我创建了那个 PNG 文件并将它存储在 Finder 的一个文件夹中。
然后我在项目导航器(Xcode 8.2)中选择根节点,转到“常规”选项卡并打开“应用程序图标和启动图像”披露。在那里我点击了箭头图标。资产管理器显示为选中条目“AppIcon”。到目前为止一切顺利。
现在文档说我必须将我的 PNG 文件从 Finder 拖放到该资产表中。

但我的问题是我是屏幕阅读器用户,所以我无法使用鼠标来处理此类操作。这就是为什么我想问是否有使用键盘快捷键或导入菜单的替代方法,或者我是否可以通过使用文本编辑器编辑 Xcode 项目文件来手动包含 PNG 文件?非常感谢您的帮助!

sha*_*ght 5

The Assets.xcassets is simply a directory whithin your projects directory. You can modify the default app icon set by placing the .png files in:

Assets.xcassets/AppIcon.appiconset
Run Code Online (Sandbox Code Playgroud)

and modifying the contained Assets.xcassets/AppIcon.appiconset/Contents.json file like this:

{
    "images" : [
{
  "size" : "20x20",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "2x"
},
{
  "size" : "20x20",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "3x"
},
{
  "size" : "29x29",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "2x"
},
{
  "size" : "29x29",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "3x"
},
{
  "size" : "40x40",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "2x"
},
{
  "size" : "40x40",
  "idiom" : "iphone",
  "filename" : "yourFileName.png",
  "scale" : "3x"
},
{
  "idiom" : "iphone",
  "size" : "60x60",
  "scale" : "2x"
},
{
  "idiom" : "iphone",
  "size" : "60x60",
  "scale" : "3x"
},
{
  "idiom" : "ipad",
  "size" : "20x20",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "20x20",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "29x29",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "29x29",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "40x40",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "40x40",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "76x76",
  "scale" : "1x"
},
{
  "idiom" : "ipad",
  "size" : "76x76",
  "scale" : "2x"
},
{
  "idiom" : "ipad",
  "size" : "83.5x83.5",
  "scale" : "2x"
}
],
"info" : {
    "version" : 1,
    "author" : "xcode"
}
}
Run Code Online (Sandbox Code Playgroud)

Maybe you have to create the JSON file.