启动屏幕不显示 iOS 8

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27605562/
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-08-31 04:05:27  来源:igfitidea点击:

Launch Screen not displaying iOS 8

iosxcode6.1splash-screen

提问by user1898829

I'm trying to get the Launch screen to display instead I get the default black screen.

我试图让启动屏幕显示,而不是我得到默认的黑屏。

I remember I've had this issue in the past and is something really silly but I can't remember what it is.

我记得我过去曾经遇到过这个问题,这真的很愚蠢,但我不记得是什么了。

I have a LaunchScreen.xib. I've set in my target -> info to use LaunchScreen and not image catalog. I am running iOS 8 and using Xcode 6.1. I tried on all iPhone simulators and iPhone 4s.

我有一个 LaunchScreen.xib。我已经在我的目标 -> 信息中设置了使用 LaunchScreen 而不是图像目录。我正在运行 iOS 8 并使用 Xcode 6.1。我尝试了所有 iPhone 模拟器和 iPhone 4s。

I can't think what more info to give than that.

我想不出还有什么比这更多的信息了。

回答by jaga

For those who are still looking for another answer here's what worked for us:

对于那些仍在寻找其他答案的人来说,以下是对我们有用的方法:

Our launch xib only contains an imageView in the middle of the view. For some reason the image never showed (but the view was there, checked it with changing the background color).

我们的启动 xib 只在视图中间包含一个 imageView。出于某种原因,图像从未显示(但视图在那里,通过更改背景颜色进行检查)。

The solution was to move the image file out of the image catalog and just drop it in the project as a standalone file. Pretty strange considering when we tried other images from the catalog they appeared correctly but not this one. Anyway, I hope this helps someone!

解决方案是将图像文件移出图像目录,并将其作为独立文件放入项目中。考虑到当我们尝试目录中的其他图像时,它们显示正确但不是这个,这很奇怪。无论如何,我希望这对某人有所帮助!

回答by Kashif

I had the same issue. Turned out that I had earlier tried to attach a viewcontroller file with the launchscreen. To fix:

我遇到过同样的问题。原来我之前曾尝试在启动屏幕上附加一个视图控制器文件。修理:

  1. Go to launch screen
  2. Click Connections Inspector in right pane
  3. Remove all connections.
  1. 转到启动屏幕
  2. 单击右侧窗格中的连接检查器
  3. 删除所有连接。

Accoring to @doctorBroctor: also go to the File's Owner tab and remove the connections there.

根据@doctorBroctor:也转到文件所有者选项卡并删除那里的连接。

回答by Manab Kumar Mal

I have tried with:

我试过:

  1. Deleted Launch Screen File.

  2. Tapped on Use Asset Catalogin Launch Image Sourceand added Splash screenImages as desired in the image asset.

  3. Deleted Previous Project on Simulator or Device. Clear the Project.

  4. Run Again and it is showing now.

  1. 删除了启动屏幕文件。

  2. 轻敲Use Asset CatalogLaunch Image Source并加入Splash screen根据需要在图像资产图像。

  3. 已删除模拟器或设备上的先前项目。清除项目。

  4. 再次运行,它现在正在显示。

回答by aryaxt

  • Go to your launch screen
  • Go to file inspector
  • Check the checkbox for "Use as Launch Screen"
  • 转到您的启动屏幕
  • 转到文件检查器
  • 选中“用作启动屏幕”复选框

enter image description here

在此处输入图片说明

回答by Suragch

For me the problem was that I hadn't selected the LaunchScreen.storyboardin the General tab of the project settings.

对我来说,问题是我没有LaunchScreen.storyboard在项目设置的常规选项卡中选择。

enter image description here

在此处输入图片说明

回答by Steffen D. Sommer

One reason for why you might experience the black screen instead of your launch screen is that the .xibfile might not get copied in your build phase. At least that was my issue that caused my app to show the black screen even though I had done the steps you describe.

您可能会遇到黑屏而不是启动屏幕的原因之一是该.xib文件可能不会在您的构建阶段被复制。至少这是我的问题导致我的应用程序显示黑屏,即使我已经完成了你描述的步骤。

So, double check that your LaunchScreen.xib(or whatever it is named) appears in:

因此,请仔细检查您的LaunchScreen.xib(或任何名称)是否出现在:

Your target -> Build Phases -> Copy Bundle Resources

您的目标 -> 构建阶段 -> 复制捆绑资源

And if not, make sure to add it. That resolved my issue.

如果没有,请确保添加它。那解决了我的问题。

回答by Han Pengbo

I fix it by select the "is Initial View Controller" in storyboard.

我通过在故事板中选择“是初始视图控制器”来修复它。

回答by erwinnandpersad

Make sure to delete the installed app from the emulator. Then run the app again from xcode (product->clean, product->run). That worked for me.

确保从模拟器中删除已安装的应用程序。然后从 xcode 再次运行应用程序(product->clean,product->run)。那对我有用。

回答by gklka

I've experienced the same issue. The solution for me was simply delete the app, reboot the device, then reinstall it. I think iOS caches the Launchscreen, and this cache is not invalidated every time when it should be.

我也遇到过同样的问题。我的解决方案是简单地删除应用程序,重新启动设备,然后重新安装它。我认为 iOS 会缓存 Launchscreen,并且该缓存不会每次都失效。

回答by Anand

I had the same issue in iOS 9 as well. Deleting the old app in simulator alone is not enough. Simulator has to be quit launched. It worked for me.

我在 iOS 9 中也遇到了同样的问题。仅在模拟器中删除旧应用程序是不够的。模拟器必须退出启动。它对我有用。