LaunchScreen.storyboard bug in swift

时间:2017-11-13 06:34:20

标签: ios iphone xcode

I was using LaunchScreen.storyboard without problems. but I changed LaunchScreen.storyboard file name to LaunchScreen2.storyboard since I hoped not to use the splash image. (I thought it could decrease loading time) However, I couldn't see the loading time differences.

So I renamed the file to LaunchScreen.storyboard to use splash image again. But the problem began from here.

Even though I change images in LaunchScreen.Storyboard:-

  1. Only black screen is shown shortly when I run my app on simulators.
  2. Old LaunscScreen.storyboard is shown when I run the app on my iPad.

I took some.. actions but it didn't work. (use image in Assets.cassettes, make sure Launch Screen File name in project option)

Is there anyone who can help me?

*I attached screenshots my project setting

LaunchScreen.storyboard detail

(I'm using the latest Xcode, Version 9.1 (9B55))

3 个答案:

答案 0 :(得分:0)

这是iOS问题(操作系统级别)iOS缓存LaunchScreen.storyboard图像资源并重复使用

为什么你的行动不起作用,因为

    模拟器上的
  1. app尚未缓存LaunchScreen,因此显示黑屏(未找到LaunchScreen.storyboard)
  2. iPad已缓存并使用了LaunchScreen资源(LaunchScreen.storyboard),因此显示了旧的资源
  3. 常见的解决方案是删除app或关闭,并在iPhone或iPad上删除兑现资源。 iOS在Srpingboard(操作系统级别)中管理此资源所以它不是一个完整的解决方案,但促使缓存从操作系统中快速删除。只是等待..直到iOS擦除它

答案 1 :(得分:0)

看起来像LunchScreen没有正确显示。 可能的解决方案是:

  1. 首先重新启动Xcode
  2. 从模拟器和设备中删除应用
  3. 重新打开Xcode构建并重新运行
  4. 希望它能奏效。

    如果没有,请查看info.plist以获取LunchScreen.storyboard名称。将屏幕背景颜色设置为白色,并为启动屏幕图像设置另一种颜色。一次又一次检查。希望你能找到解决方案。

答案 2 :(得分:0)

我想我发现问题的根本原因持续了一个多月。

至少在我的情况下,问题发生是因为LaunchScreen文件中没有入口点。 设置入口点后,我可以看到LaunchScreen。 enter image description here