獲取啓動圖片

    CGSize viewSize  = self.window.bounds.size;

    NSString * viewOrientation = @"Portrait";

    NSString * launchImage = nil;

    NSArray * imageDict = [[[NSBundle mainBundle] infoDictionary]valueForKey:@"UILaunchImages"];

    for (NSDictionary  * dict in imageDict) {

        CGSize imageSize = CGSizeFromString(dict[@"UILaunchImageSize"]);

        if (CGSizeEqualToSize(imageSize, viewSize) && [viewOrientation isEqualToString:dict[@"UILaunchImageOrientation"]]) {

            launchImage = dict[@"UILaunchImageName"];

            

        }

    }

    _launchImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:launchImage]];

    self.window.backgroundColor = [UIColor whiteColor];

    _launchImg.frame = self.window.bounds;

    _launchImg.contentMode = UIViewContentModeScaleAspectFill;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章