iOS Xcode LaunchScreen Storyboard 不显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36947371/
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
iOS Xcode LaunchScreen Storyboard not displaying
提问by A. Vin
I'm trying to use Xcode's LaunchScreen storyboardas my launch screen? All the questions that have previously been asked about this refer back to the old launch image or .xib method - trying to do it now with the new LaunchScreen storyboard that Xcode automatically generates instead. I've selected the LaunchScreen storyboard as my launch screen file in my Deployment Info:
我正在尝试使用 Xcode 的LaunchScreen 故事板作为我的启动屏幕?之前有关此问题的所有问题都可以追溯到旧的启动图像或 .xib 方法 - 现在尝试使用 Xcode 自动生成的新 LaunchScreen 故事板来执行此操作。我在我的部署信息中选择了 LaunchScreen 故事板作为我的启动屏幕文件:
The storyboard itself confirms that it is set as the launch screen in it's file inspector.
故事板本身确认它被设置为文件检查器中的启动屏幕。
And the info.plist file reflects this as well.
info.plist 文件也反映了这一点。
And yet, it doesn't work. The LaunchScreen storyboard never shows - it just goes straight to the first screen in my main storyboard. Using Xcode 7.2 and deploying to iOS 9.
然而,它不起作用。LaunchScreen 故事板从不显示 - 它只是直接进入我的主故事板中的第一个屏幕。使用 Xcode 7.2 并部署到 iOS 9。
采纳答案by A. Vin
In case anyone else runs into this issue, I resolved it by simply deleting the ViewController on my LaunchScreen storyboard (leaving me with an empty storyboard), creating a new ViewController and resetting the Storyboard entry point to that new ViewController. There may be some sort of bug with XCode 7.2 with respect to the LaunchScreen storyboard and default entry point into the auto-created View Controller, but then again, I've tried replicating this 3 times and it hasn't ever repeated itself, so maybe not.
万一其他人遇到这个问题,我通过简单地删除 LaunchScreen 故事板上的 ViewController(给我留下一个空的故事板)、创建一个新的 ViewController 并将 Storyboard 入口点重置为该新的 ViewController 来解决它。XCode 7.2 可能存在某种关于 LaunchScreen 故事板和自动创建的视图控制器的默认入口点的错误,但话说回来,我已经尝试复制了 3 次,但它从来没有重复过,所以也许不吧。
回答by StackUnderflow
回答by abanet
If you are using xcode 11.2you'll need to remove the app and execute it again to see the launch screen. I have to do this every time I modify the launch screen in order to see the new changes.
如果您使用的是xcode 11.2,则需要删除该应用程序并再次执行以查看启动屏幕。每次修改启动屏幕时我都必须这样做才能看到新的更改。
回答by Marcy
**Delete the app from the device. Re-run. **
**从设备中删除应用程序。重新运行。**
In my case I had all the suggested settings set correctly but continued to have the original blank launchscreen. In the spirit of AmJa's suggestion regarding a "cache" problem, I deleted my app from my device and reinstalled. Reinstalling did the trick for me on both my devices and simulators.
就我而言,我已正确设置了所有建议的设置,但仍保留原始的空白启动屏幕。本着 AmJa 关于“缓存”问题的建议的精神,我从我的设备中删除了我的应用程序并重新安装。重新安装在我的设备和模拟器上都对我有用。
回答by Sivajee Battina
As @abanet, mentioned in his answer, anyone who uses Xcode 11.2and above, they have to delete their app and launch it againto see launch screen changes. It's not reflecting immediately. It looks like a bug from Xcode definitely not an intension.
正如@abanet 在他的回答中提到的那样,任何使用Xcode 11.2及更高版本的人都必须删除他们的应用程序并再次启动它才能看到启动屏幕的变化。它不会立即反映。它看起来像是来自 Xcode 的错误,绝对不是意图。
回答by Vicki Lee
回答by AmJa
Just in case it helps someone. Scenario, I created my new project and copied a old Launch Image from another project. And then started getting the launch image but when I wanted to change it to new image then still i was viewing the old image it was stuck for ever as launch image no matter what I do. Then I reset my Simulator and restarted my iPhone and there you go I stared getting the new image. This looks like that somewhere in the documents or cache the devices store the old image until you reset the phone. Thanks
以防万一它可以帮助某人。场景,我创建了我的新项目并从另一个项目复制了一个旧的 Launch Image。然后开始获取启动图像,但是当我想将其更改为新图像时,我仍然在查看旧图像,无论我做什么,它都会永远作为启动图像卡住。然后我重置了我的模拟器并重新启动了我的 iPhone 就这样,我盯着新图像。这看起来像是在文档或缓存设备中的某处存储旧图像,直到您重置手机。谢谢
回答by Johnny Rockex
回答by Martin Berger
In storyboard, in ViewController scene, I had to check Is Initial View Controller for storyboard to be seen as Launch Storyboard.
在故事板中,在 ViewController 场景中,我必须检查是否为初始视图控制器以将故事板视为启动故事板。
Suprisingly this is not checked when you add first View Controller. Xcode 11.
令人惊讶的是,当您添加第一个 View Controller 时,这并没有被检查。Xcode 11.
回答by Curtis
If you don't see anything and your Launchscreen.storyboard only has an ImageView in it, then it might actually be showing the storyboard but not the image. Try putting a button in it or something. I've discovered that my Launchscreen.storyboard is actually showing but won't show any images and I don't know why.
如果您没有看到任何内容并且 Launchscreen.storyboard 中只有一个 ImageView,那么它实际上可能显示的是故事板而不是图像。尝试在其中放一个按钮或其他东西。我发现我的 Launchscreen.storyboard 实际上正在显示但不会显示任何图像,我不知道为什么。