美文网首页
launchImage 图片获取

launchImage 图片获取

作者: 工藤辞辞 | 来源:发表于2016-11-14 10:13 被阅读9次
    
    CGSize viewSize = CGSizeMake(UIScreenWidth, UIScreenHeight);
    
    NSString *viewOrientation = @"Portrait";    //横屏请设置成 @"Landscape"
    
    NSString *launchImage = nil;
    
    NSArray* imagesDict = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
    
    for (NSDictionary* dict in imagesDict)
    
    {
    
    CGSize imageSize = CGSizeFromString(dict[@"UILaunchImageSize"]);
    
    if (CGSizeEqualToSize(imageSize, viewSize) && [viewOrientation isEqualToString:dict[@"UILaunchImageOrientation"]])
    
    {
    
    launchImage = dict[@"UILaunchImageName"];
    
    }
    
    }
    
    _img.image = [UIImage imageNamed:launchImage];
    
    

    相关文章

      网友评论

          本文标题:launchImage 图片获取

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