Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaunchScreen.xib not displaying my custom font

Tags:

xcode

ios

I'm using a label to display text with my custom font on LaunchScreen.xib. My custom font shows up fine in the Interface Builder, but when I test it on my iPhone the font reverts back to the default font.

Not sure how to fix this or if it's a bug.

like image 671
user3781632 Avatar asked Feb 10 '15 23:02

user3781632


People also ask

Can I delete LaunchScreen storyboard?

You must have a launch screen, either provided by a storyboard or using images in an asset catalog. If you remove both of these then iOS will assume that your app doesn't support larger displays, which is why you are getting the black bars; your app is running in backward-compatibility mode.

How do I use storyboard in LaunchScreen?

storyboard to configure your launch screen. If your project doesn't contain a default launch screen file, add a launch screen file and set the launch screen file for the target in the project editor. Choose File > New > File. Under User Interface, select Launch Screen, and click Next.

What is LaunchScreen storyboard?

The LaunchScreen. storyboard is an interface builder storyboard file that uses auto-layout and some basic constraints on the controls to adjust the display for all the supported devices. Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.


2 Answers

There's no big surprise here. The launch screen is shown at launch time - actually, before launch time - so the font probably hasn't yet loaded.

You could file a bug if you think you have a compelling use case. But I don't really think you do. Why are you showing any text in your launch image? It should be much more bare-bones than that - just enough to give the structure of the opening interface, which will be filled in when the opening interface actually appears. A "blank" screen with the same background color as the initial view controller's background color would be sufficient. You goal is just to provide an alternative to blackness.

like image 136
matt Avatar answered Oct 19 '22 03:10

matt


A quick workaround is to use an UIImageView and have your text as UIImage on it, literally a picture of your text as .png / .jpeg or similar.

Note: It may take some time before you can see the image, I had to clean the Build Folder and reinstall the app a couple of times in order to see the image.

Another note: If you want to support multiple languages with different texts you will need to have different images for each language using this approach.

like image 21
Gustavo Vollbrecht Avatar answered Oct 19 '22 03:10

Gustavo Vollbrecht