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

获取启动页用图

作者: XP_Swf | 来源:发表于2017-03-24 11:11 被阅读0次

- (UIImage *)launchImage {

UIImage    *lauchImage  = nil;

NSString    *viewOrientation = nil;

CGSize    viewSize  = [UIScreen mainScreen].bounds.size;

UIInterfaceOrientation orientation  = [[UIApplication sharedApplication] statusBarOrientation];

if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {

viewOrientation = @"Landscape";

} else {

viewOrientation = @"Portrait";

}

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

for (NSDictionary *dict in imagesDictionary) {

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

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

lauchImage = [UIImage imageNamed:dict[@"UILaunchImageName"]];

}

}

return lauchImage;

}

相关文章

  • 获取启动页用图

    - (UIImage *)launchImage { UIImage *lauchImage = nil; NS...

  • 获取启动页图片

  • iOS11 适配

    1、启动页 如果启动页采用 Launch Imaged Sourc,则需要添加iPhoneX的启动图,不然整个 A...

  • 获取系统的启动页 iOS

    //自动获取系统的启动页 -(UIImage *)getLuanchImage{ CGSize viewSize ...

  • 产品的生命周期

    启动阶段 (产品从0到1,提升体验) 发现需求 用户访谈 产品脑图 竞品分析 流程图 产品原型图 prd获取种子用...

  • XCode 10 GM Screen Bounds

    启动页用的是图片LaunchImage的时候: iPhone XS Max 里面获取的 虽然显示上一切正常,但代码...

  • App启动页优化

    功能:启动页展示logo和服务器配置的广告图 app启动方式 冷启动问题 给启动页设置布局,logo闪现问题

  • 从Images.xcassets获取默认启动图LaunchIma

    从Images.xcassets获取默认启动图LaunchImage iOS应用程序都有个默认启动图(Launch...

  • Android-总结Drawable用法

    今天为了适配启动页背景图,接触到了BitmapDrawable保证了启动页的背景图不变形。想想之前真的没用过,所以...

  • iOS获取启动图

    获取App启动图的方法 为启动图添加一个动画效果 NSString转NSData NSData转NSString

网友评论

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

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