美文网首页
2018-03-14如何在代码中利用app图标

2018-03-14如何在代码中利用app图标

作者: songjk | 来源:发表于2018-03-14 10:17 被阅读0次

第一步获取bundle中的路径信息:

       NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];

第二部:获取app中所有icon名字数组

        NSArray *iconsArr = infoDict[@"CFBundleIcons"][@"CFBundlePrimaryIcon"][@"CFBundleIconFiles"];

第三部取出icon的名字,然后创建UIImage

        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",[iconsArr lastObject]]];

相关文章

网友评论

      本文标题:2018-03-14如何在代码中利用app图标

      本文链接:https://www.haomeiwen.com/subject/jpnxqftx.html