如何获取ios中当前的应用程序图标 [英] How to get the current application icon in ios
本文介绍了如何获取ios中当前的应用程序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在可爱触摸应用程序中获取当前的应用程序图标?
谢谢。
Is there a way to get the current application icon in a cocoa-touch app? Thank you.
推荐答案
我完全基于 moosgummi
',但返回 UIImage
p>
I based my answer completely on moosgummi
's, but returning a UIImage
instead.
UIImage *appIcon = [UIImage imageNamed: [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIconFiles"] objectAtIndex:0]];
UIImage
自动选择合适的版本正常, @ 2x
,〜ipad
,〜ipad @ 2x
或任何未来的后缀)。 (BTW,你不是只是讨厌这个愚蠢的计划来识别图像的版本?它只是失控了。感谢上帝的资产目录!)
The UIImage
automatically selects the suitable version (normal, @2x
, ~ipad
, ~ipad@2x
or any future suffix). (BTW, don't you just hate this stupid scheme for identifying versions of images? It was just getting out of hand. Thank god for Asset Catalogues!)
这篇关于如何获取ios中当前的应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文