在ios中设置launchscreen.xib的背景图像

Sid*_*Dev 3 iphone user-interface xcode ios

我需要在iOS应用程序的启动屏幕中设置背景颜色或背景图像.我想知道是否有类似的代码:

self.view.backgroundcolor=[UIColor redColor];
Run Code Online (Sandbox Code Playgroud)

谢谢

Aja*_*ani 9

如果要为启动屏幕设置背景图像,则有两种方式:

  1. 使用image.axassets并添加新的LaunchImage集.
  2. 您可以添加UIImageViewLaunchScreen.xib并设置图像给它.

如果你想设置背景颜色为启动图像不是添加UIViewLaunchScreen.xib并设置backgroundColor它propertity.

两种方式都很简单,但我更喜欢使用image.axassets LunchImage设置.

注意:如果使用image.axassetsLaunchImage,请不要忘记使用应用程序迁移此集.