NSDictionary * dic = @{@"320x480" : @"LaunchImage-700", @"320x568" : @"LaunchImage-700-568h", @"375x667" : @"LaunchImage-800-667h", @"414x736" : @"LaunchImage-800-Portrait-736h"};
NSString * key = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];
UIImage * launchImage = [UIImage imageNamed:dict[key]];
NSString * key = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];
UIImage * launchImage = [UIImage imageNamed:dict[key]];
本文介绍了一种使用 NSDictionary 存储不同屏幕尺寸对应的启动图片名称的方法,并通过获取当前设备屏幕尺寸动态选取合适的启动图片。
1万+

被折叠的 条评论
为什么被折叠?



