设为首页 加入收藏

TOP

iOS获取app图标和启动图片名字(AppIcon and LaunchImage's name)(二)
2017-10-13 09:46:27 】 浏览:12277
Tags:iOS 获取 app 图标 启动 图片 名字 AppIcon and LaunchImage' name
。。。

打印所有信息看看:

/** 打印app工程配置信息 */
- (void)printInfoDictionary{
    
    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
    NSLog(@"%@", infoDict);
    
    /*
     打印日志:
     {
         BuildMachineOSBuild = 15G31;
         CFBundleDevelopmentRegion = en;
         CFBundleExecutable = TanTest;
         CFBundleIcons =     {
             CFBundlePrimaryIcon =         {
                 CFBundleIconFiles =             (
                     AppIcon29x29,
                     AppIcon40x40,
                     AppIcon60x60
                 );
             };
         };
         CFBundleIdentifier = "net.tan.xxx";
         CFBundleInfoDictionaryVersion = "6.0";
         CFBundleInfoPlistURL = "Info.plist -- file:///Users/PX/Library/Developer/CoreSimulator/Devices/7020368B-C160-42C0-B3C5-5F958FA82EF5/data/Containers/Bundle/Application/77D8C333-A6AF-4183-B79A-A5BEDCD08E1A/TanTest.app/";
         CFBundleName = TanTest;
         CFBundleNumericVersion = 16809984;
         CFBundlePackageType = APPL;
         CFBundleShortVersionString = "1.0";
         CFBundleSignature = "????";
         CFBundleSupportedPlatforms =     (
            iPhoneSimulator
         );
         CFBundleVersion = 1;
         DTCompiler = "com.apple.compilers.llvm.clang.1_0";
         DTPlatformBuild = "";
         DTPlatformName = iphonesimulator;
         DTPlatformVersion = "9.3";
         DTSDKBuild = 13E230;
         DTSDKName = "iphonesimulator9.3";
         DTXcode = 0731;
         DTXcodeBuild = 7D1014;
         LSRequiresIPhoneOS = 1;
         MinimumOSVersion = "6.0";
         UIDeviceFamily =     (
         1
         );
         UILaunchImageFile = LaunchImage;
         UILaunchImages =     (
             {
                 UILaunchImageMinimumOSVersion = "8.0";
                 UILaunchImageName = "LaunchImage-800-Portrait-736h";
                 UILaunchImageOrientation = Portrait;
                 UILaunchImageSize = "{414, 736}";
             },
             {
                 UILaunchImageMinimumOSVersion = "8.0";
                 UILaunchImageName = "LaunchImage-800-Landscape-736h";
                 UILaunchImageOrientation = Landscape;
                 UILaunchImageSize = "{414, 736}";
             },
             {
                 UILaunchImageMinimumOSVersion = "8.0";
                 UILaunchImageName = "LaunchImage-800-667h";
                 UILaunchImageOrientation = Portrait;
                 UILaunchImageSize = "{375, 667}";
             },
             {
                 UILaunchImageMinimumOSVersion = "7.0";
                 UILaunchImageName = "LaunchImage-700";
                 UILaunchImageOrientation = Portrait;
                 UILaunchImageSize = "{320, 480}";
             },
             {
                 UILaunchImageMinimumOSVersion = "7.0";
                 UILaunchImageName = "LaunchImage-700-568h";
                 UILaunchImageOrientation = Portrait;
                 UILaunchImageSize = "{320, 568}";
             }
         );
         UILaunchStoryboardName = LaunchScreen;
         UIMainStoryboardFile = Main;
         UIRequiredDeviceCapabilities =     (
            armv7
         );
         UISupportedInterfaceOrientations =     (
            UIInterfaceOrientationPortrait
         );
     }
     */
}
View Code

 

----------- 接下来我们再来在app既支持iPhone和iPad设备,又支持横屏和竖屏时,AppIcon和LaunchImage是怎样的以及如何获取  ---------

先上两张图,再上测试代码:

 

测试代码:

1、获取AppIcon所有icon图标名称

/** 支持iPhone和iPad, 获取app的icon图标名称 */
- (void)getAppIconName{
    
    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
    
    //获取app中所有icon名字数组
    NSArray *iconsArr = infoDict[@"CFBundleIcons"][@"CFBundlePrimaryIcon"][@"CFBundleIconFiles"];
    //取最后一个icon的名字
    NSString *iconLastName = [iconsArr lastObject];
    
    //打印icon名字
    NSLog(@"iconsArr
首页 上一页 1 2 3 4 5 下一页 尾页 2/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇iOS 直播-网速监控 下一篇你真的了解UIScrollView吗?

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目