问题
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.
I can't think what more info to give than that.
回答1:
I had the same issue. Turned out that I had earlier tried to attach a viewcontroller file with the launchscreen. To fix:
- Go to launch screen
- Click Connections Inspector in right pane
- Remove all connections.
Accoring to @doctorBroctor: also go to the File's Owner tab and remove the connections there.
回答2:
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).
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!
回答3:
- Go to your launch screen
- Go to file inspector
- Check the checkbox for "Use as Launch Screen"
回答4:
I have tried with:
Deleted Launch Screen File.
Tapped on
Use Asset Catalog
inLaunch Image Source
and addedSplash screen
Images as desired in the image asset.Deleted Previous Project on Simulator or Device. Clear the Project.
Run Again and it is showing now.
回答5:
One reason for why you might experience the black screen instead of your launch screen is that the .xib
file 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.
So, double check that your LaunchScreen.xib
(or whatever it is named) appears in:
Your target -> Build Phases -> Copy Bundle Resources
And if not, make sure to add it. That resolved my issue.
回答6:
For me the problem was that I hadn't selected the LaunchScreen.storyboard
in the General tab of the project settings.
回答7:
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.
回答8:
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.
回答9:
I've looked at all the above answers, it helped a bit. Especially the answer by Suragch put me in right direction.
The LaunchScreen.storyboard isn't showing up, even after applying simple background colour to the view and removing the image.
Firstly, I cannot see the "LaunchScreen.storyboard" as shown in the image
This was because, some reason the LaunchScreen.storyboard wasn't added to the build Target. Solution: Ensure the LaunchScreen.storyboard is included to the build Target. Also, Choose the LaunchScreen.storyboard from the drop down as shown in above pic.
I hope it helps someone!
回答10:
I found this old post 'cause my launch screen WAS working, then it stopped. I thrashed around for a good while and then realized this, undocumented problem:
If your launch XIB or storyboard file has a UIImageView with an image whose name contains a space, the entire screen won't load.
回答11:
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.
回答12:
I only had a centered UIImageView in my LaunchScreen.xib that contained an image (.png file), and had the same black screen showing.
I removed the image (the .png file) from the project, added it again with new name, and used the new image.
回答13:
Make sure to use empty Launch Screen File
, then Xcode would use Launch Image Source.
回答14:
I fix it by select the "is Initial View Controller" in storyboard.
回答15:
Make sure you have "is initial View Controller" checked in interface builder. I tried pretty much everything else but this finally fixed the problem and now it works in simulator as well as the device.
回答16:
New feature in the iOS 8 SDK: you can now use a storyboard scene in place of your app’s launch images.
Create a blank storyboard file named LaunchScreen.storyboard.
Go to your target settings and, on the General tab, select the storyboard as your Launch Screen File. Xcode will add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.
Add a view controller scene to the storyboard. Add some subviews to the scene and position them with constraints. When you launch the app on a device, the OS should use the scene as the launch screen.
For more information check out this blog post by Ole Begemann "Replacing Launch Images With Storyboards".
回答17:
Your launch image should be a PNG. A JPEG may work under certain targets, but you should use PNG anyway.
来源:https://stackoverflow.com/questions/27605562/launch-screen-not-displaying-ios-8