I sometimes face a very strange issue on launch screen. I'm using a xib file with just a UIImageView
on it, however sometimes the image is just a black rectangle.
I've tried to switch between .jpg and .png files but this didn't help, I've also assigned a different image property profile to it.
This happens on devices running iOS 9.
These are the constraints for the UIImageView
. I've removed the image, as it's a logo of a client.
UIImage contains the data for an image. UIImageView is a custom view meant to display the UIImage . Save this answer.
Whenever you want an image in a view controller, you use a UIImageView. A UIImageView contains a UIImage, which is the raw bitmap, and allows you to configure how you want to scale or crop the image.
A launch screen is the very first screen presented to users when your app starts up. When you create a new project with UIKit, Xcode automatically generates a storyboard file named LaunchScreen. storyboard for developers to design the launch screen of the app.
I have the same problem. I've tried:
Finally, i found a way which works not only for temporary(I've tested for one hour, just repeat build and run for like 100 times, watch TV meanwhile).
This issue is somehow related to the .png image. I dragged my .png file to photoshop, then go File > Save for web (Command + Option + Shift + S), make sure the transparency is unchecked, export a new .png file. replace the old file with then new one you'll find the issue is fixed.
But I'm still confused why a issued .png file can work for a while.
I have the same problem that appears from time to time on some devices. Last thing that helped was a full restart of a device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With