An example of getting launchimage startup diagram in IOS development

Time:2020-10-22

Examples are as follows:

#define KYRect [UIScreen mainScreen].bounds

//Get startup image
 CGSize viewSize = KYRect.size;
 //Please set horizontal screen to @ "landscape"
 NSString *viewOrientation = @"Portrait";
 NSString *launchImageName = 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"]])
  {
   launchImageName = dict[@"UILaunchImageName"];
  }
 }
 UIImage * launchImage = [UIImage imageNamed:launchImageName];
//Set the background image of the current view as the startup image
 self.view.backgroundColor = [UIColor colorWithPatternImage:launchImage];

The above example of getting launchimage startup diagram from IOS development is the whole content shared by Xiaobian. I hope it can give you a reference, and I hope you can support developeppaer more.

Recommended Today

Layout of angular material (2): layout container

Layout container Layout and container Using thelayoutDirective to specify the layout direction for its child elements: arrange horizontally(layout=”row”)Or vertically(layout=”column”)。 Note that if thelayoutInstruction has no value, thenrowIs the default layout direction. row: items arranged horizontally.max-height = 100%andmax-widthIs the width of the item in the container. column: items arranged vertically.max-width = 100%andmax-heightIs the height of the […]