iOS在运行时更改应用程序图标 [英] iOS Changing App icon at runtime

查看:97
本文介绍了iOS在运行时更改应用程序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行时更改我的应用图标。我在SO上阅读了其他类似的线程,他们说使用Apple认可的API是不可能的。其中一个回复提到它可能使用受限制的API,但没有详细说明。

I want to change my app icon at runtime. I read other similar threads on SO, and they say that it is not possible using Apple sanctioned APIs. One of the responses mentioned that its possible using restricted APIs, but did not elaborate.

我理解如果我使用受限制的API,我的应用范围将缩减为监狱 - 只有破碎的设备。我很好,但是如何实现这个功能。

I understand that if I use restricted APIs, my application scope will be reduced to jail-broken devices only. I'm ok with that, but how do I implement this feature.

对不起,我不能指出这个问题的任何研究工作,因为我不知道怎么去它甚至如何开始这个。

Sorry, I cannot indicate any research effort for this question because I have no idea how to go about it or even how to get started on this.

提前致谢:)

推荐答案

虽然这是一个老问题,但我最近发现现在可以使用iOS 10.3了:

Although this is an old question, I recently discovered this is now possible, as of iOS 10.3:

https://developer.apple.com/documentation/uikit/uiapplication/2806818-setalternateiconname

...使用 UIApplication.setAlternateIconName(_:completionHandler:) API。

...using the UIApplication.setAlternateIconName(_:completionHandler:) API.

但请注意,您只能使用已作为应用套装一部分提供的图标。

Note however you are limited to using icons which are already shipped as part of the app bundle.

这篇关于iOS在运行时更改应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆