美文网首页
xcode7 获取 LaunchImage

xcode7 获取 LaunchImage

作者: Yang152412 | 来源:发表于2016-05-18 22:48 被阅读50次
@implementation UIImage (GetLaunchImage)

+ (UIImage *)getTheLaunchImage {    
    NSDictionary * dict = @{@"320x480" : @"700", @"320x568" : @"700-568h", @"375x667" : @"800-667h", @"414x736" : @"800-Portrait-736h"};
    NSString * key = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];
     // Brand Assets 和 Assets.xcassets 中作为 LaunchImage的 assets 名字保持一致
    NSString *imageName = [NSString stringWithFormat:@"Brand Assets-%@",dict[key]];    return [UIImage imageNamed:imageName];}
@end

相关文章

网友评论

      本文标题:xcode7 获取 LaunchImage

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