美文网首页
获取启动页图片

获取启动页图片

作者: CoderCurtis | 来源:发表于2018-12-12 16:38 被阅读15次
    //获取启动图
    - (UIImage *)getLaunchImage{
        
        CGSize viewSize = [UIScreen mainScreen].bounds.size;
        NSString *viewOr = @"Portrait";//垂直
        NSString *launchImage = nil;
        NSArray *launchImages =  [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
        
        for (NSDictionary *dict in launchImages) {
            CGSize imageSize = CGSizeFromString(dict[@"UILaunchImageSize"]);
            
            if (CGSizeEqualToSize(viewSize, imageSize) && [viewOr isEqualToString:dict[@"UILaunchImageOrientation"]]) {
                launchImage = dict[@"UILaunchImageName"];
            }
        }
        return [UIImage imageNamed:launchImage];
    }
    

    相关文章

      网友评论

          本文标题:获取启动页图片

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