xcode 在ios中为launchscreen.xib设置背景图片

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29672955/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:00:38  来源:igfitidea点击:

Set background image for launchscreen.xib in ios

iosiphonexcodeuser-interface

提问by Sidharth J Dev

I need to set a background color or background image in my iOS application's launch screen. I was wondering if there was a code similar to:

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

self.view.backgroundcolor=[UIColor redColor];

Thank you

谢谢

回答by Ajay Gabani

If you want to set background image for launch screen than there is two way:

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

  1. Use image.axassetsand add new LaunchImage set in it.
  2. You can add UIImageViewin LaunchScreen.xiband set image to it.
  1. 使用image.axassets并在其中添加新的 LaunchImage 集。
  2. 您可以添加UIImageViewLaunchScreen.xib和一套图像它。

If you want to set background colour for launch image than add UIViewin LaunchScreen.xiband set backgroundColorpropertity of it.

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

Both way is easy but I preferred to go with image.axassets LunchImage set.

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

Note: If you use image.axassetsLaunchImage than do not forget to migrate this set with application.

注意:如果您使用image.axassetsLaunchImage,请不要忘记将此集与应用程序一起迁移。