如何在 XCode 5 中添加 57x57 图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18908019/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:55:35  来源:igfitidea点击:

How to add icon 57x57 in XCode 5

iphonexcodexcode5

提问by Sam B

I am working with Xcode 5 and created 3 icons

我正在使用 Xcode 5 并创建了 3 个图标

  • iphone-58.png
  • iPhone-80.png
  • iphone-120.png
  • iphone-58.png
  • iPhone-80.png
  • iphone-120.png

When I created my projected I dragged and dropped these three icons into image.xcassets. see screenshot.

创建投影时,我将这三个图标拖放到 image.xcassets 中。看截图。

Now when I compile my project I get this error that 57x57 & 57x57@2x icons are missing. How do I add them? I don't see any spot in AppIcon section. What did I miss?

现在,当我编译我的项目时,我收到此错误,即 57x57 和 57x57@2x 图标丢失。我如何添加它们?我在 AppIcon 部分看不到任何位置。我错过了什么?

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Nareshkumar

You can choose the icon sets that are required. enter image description here

您可以选择所需的图标集。 在此处输入图片说明

Notice on the right side there are options for the appicon sets. Choose whichever one you want to put.

注意右侧有应用图标集的选项。选择您想要放置的任何一个。

回答by damithH

Use Below steps

使用以下步骤

1 - Go to Project Navigator
2 - chose (click on) Images.xcassetsFile
3 - Click on APPIcon( Left Top Corner)
4 - Go to Attributes Inspector
5 - Chose what you want.

1 - 转到Project Navigator
2 - 选择(单击)Images.xcassets文件
3 - 单击APPIcon(左上角)
4 - 转到Attributes Inspector
5 - 选择您想要的。

enter image description here

在此处输入图片说明

Simple.

简单的。

Thanks DamithH

感谢 DamithH

回答by Sam B

I had to do this the hack job way.

我必须以黑客工作的方式做到这一点。

  • Go to your project folder
  • navigate to Images.xcassets
  • navigate to AppIcon.appiconset
  • edit Contents.json file
  • add this

    { "images" : [ { "size" : "57x57", "idiom" : "iphone", "filename" : "iphone-57.png", "scale" : "1x" }, { "size" : "57x57", "idiom" : "iphone", "filename" : "iphone-114.png", "scale" : "2x" },
    { "size" : "29x29", "idiom" : "iphone", "filename" : "iphone-58.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "iphone-80.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "iphone-120.png", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } }

  • now copy your two icons and paste them in AppIcon.appiconset dir i.e. iphone-57.png & iphone-114.png

  • 转到您的项目文件夹
  • 导航到 Images.xcassets
  • 导航到 AppIcon.appiconset
  • 编辑 Contents.json 文件
  • 添加这个

    {“图像”:[{“大小”:“57x57”,“惯用语”:“iphone”,“文件名”:“iphone-57.png”,“比例”:“1x”},{“大小”:“ 57x57", "idiom": "iphone", "filename": "iphone-114.png", "scale": "2x" },
    { "size": "29x29", "idiom": "iphone", "文件名”:“iphone-58.png”,“比例”:“2x”},{“大小”:“40x40”,“惯用语”:“iphone”,“文件名”:"iphone-80.png", "scale": "2x" }, { "size": "60x60", "idiom": "iphone", "filename": "iphone-120.png", "scale" : “2x”}],“信息”:{“版本”:1,“作者”:“xcode”}}

  • 现在复制你的两个图标并将它们粘贴到 AppIcon.appiconset 目录中,即 iphone-57.png 和 iphone-114.png

Either this is a xcode bug or apple has assumed none of the apps made in xcode 5 will ever run on iphone 4 or lower or ios 6 or there has to be an easier way

这是一个 xcode 错误,或者苹果认为 xcode 5 中制作的任何应用程序都不会在 iphone 4 或更低版本或 ios 6 上运行,或者必须有更简单的方法

enter image description here

在此处输入图片说明

回答by Vaiden

My designer uses makeappicon.com, so I get a neat AppIcon.appiconsetdir that I just need to drag into Images.xcassets.

我的设计师使用makeappicon.com,所以我得到了一个整洁的AppIcon.appiconset目录,我只需要将它拖入Images.xcassets.

Using this service you can get Android cuts as well.

使用此服务,您也可以获得 Android 削减。

And it's free.

而且它是免费的。

回答by Marcelo Fabri

The right panel (where are the icons) is bigger than Xcode screen sometimes, but the panel doesn't have a scroll. Try to hide both Navigator and Utilities to have more room for the main content.

右侧面板(图标在哪里)有时比 Xcode 屏幕大,但面板没有滚动。尝试隐藏导航器和实用程序,以便为主要内容留出更多空间。