简体   繁体   English

更新iOS应用程序的应用程序图标

[英]Updating App icon for an iOS app

This question has been asked before also but i have a slightly different question to the previous ones or we can say an extended version 之前也有人问过这个问题,但我的问题与以前的问题略有不同,或者我们可以说是扩展版本

Q1) I tried updating the icon app by adding the image in asset catalog and pointing the "Target" app icon setting to that. Q1)我尝试通过在资产目录中添加图像并将“目标”应用程序图标设置指向该图标来更新图标应用程序。 The app icon is updated in my Xcode but not reflecting when i run the app.I read somewhere that i have to update this in my "Project" file as well. 该应用程序图标已在我的Xcode中更新,但未在我运行该应用程序时反映出来。我读到某个地方,也必须在“项目”文件中对此进行更新。 this can be done by following the path Project->General->App icon. 这可以通过遵循路径Project-> General-> App icon来完成。 The problem is that this "General" panel is visible for me only in Target and not in "Project" File.I only have "Info" and "build Settings" for Project. 问题在于,该“常规”面板仅在Target中可见,而在“ Project”文件中不可见。我只有Project的“ Info”和“ build Settings”。 I am using Xcode6.1 我正在使用Xcode6.1

Q2) I'll go ahead and be optimistic in assuming that i'll get a solution for this which takes me to my second question. Q2)我会继续乐观,并假设我会为此找到解决方案,这使我想到了第二个问题。

Is it possible to dynamically update an app icon? 是否可以动态更新应用程序图标? For eg-> i have my app icon as red, now once i launch my app i have a menu of colours to select from. 对于例如->我的应用程序图标为红色,现在一旦启动我的应用程序,我就有一个颜色菜单可供选择。 Once i do select one colour say green.., my original app icon should update to green. 一旦我选择一种颜色说绿色,我的原始应用程序图标应更新为绿色。 so that when i minimize or quit my app the icon has turned to be green.One live example of this is the Calendar app and the Clock app available in iOS where the icon keeps changing relative to date and time 因此,当我最小化或退出我的应用程序时,图标变为绿色。其中一个实时示例是iOS中可用的Calendar应用程序和Clock应用程序,其中图标相对于日期和时间不断变化

Thanks for the solutions in advance. 感谢您提前提出解决方案。

No, you can't change your app and the resources in its bundle. 不,您不能更改应用程序及其捆绑包中的资源。

Apple's own apps are exceptions of course. 苹果自己的应用程序当然是例外。

You cannot dynamically update the app icon. 您无法动态更新应用程序图标。

When you update the app icons (just the assets, no need to update project settings), clean and build your app in order to see the new ones. 当您更新应用程序图标(仅是资产,无需更新项目设置)时,请清理并构建您的应用程序以查看新图标。 If you cannot see them, just delete and reinstall the app. 如果看不到它们,只需删除并重新安装该应用程序即可。 Make sure that you include all the needed image resolutions for your icons. 确保包括图标所需的所有图像分辨率。

Make sure that your icon asset is selected as the app icon 确保将您的图标资产选择为应用程序图标 在此处输入图片说明 .

For your first question, I changed all my icons by simply creating a new icon set in Images.xcassets in the project Source tree. 对于第一个问题,我仅通过在项目“源”树的Images.xcassets中创建一个新图标集来更改所有图标。 You will need to make sure you have icons of the right size for all your targets. 您需要确保所有目标都有合适大小的图标。 You can either point your project at the new set or rename the old set and call your new set AppIcon. 您可以将项目指向新集合,也可以重命名旧集合,然后调用新集合AppIcon。 If you want to change the set name, the icons set used is defined in project settings in the general tab under the title "App Icons and Launch Images". 如果要更改设置名称,则在项目设置的常规选项卡中的标题“应用程序图标和启动图像”下定义使用的图标集。 Apart from that you should not need to do anything else. 除此之外,您无需执行任何其他操作。 On the simulator, removing the app and restarting might help. 在模拟器上,删除应用程序并重新启动可能会有所帮助。

For your second question the answer would seem to be that you cannot but Apple can. 对于您的第二个问题,答案似乎是您不能但苹果可以。 Never noticed before, but the clock app icon actually has a moving second hand and has the current time. 以前从未注意到过,但是时钟应用程序图标实际上具有正在移动的秒针并具有当前时间。 So clearly possible but looks like it is not allowed for normal folks: How to animate application icon in iOS? 显然有可能,但对于普通人来说似乎是不允许的: 如何在iOS中为应用程序图标设置动画?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM