简体   繁体   中英

How to specify “monospaced system font” for a UILabel in Launchscreen.storyboard using Xcode?

In Xcode version 11.5, I programmatically created a UILabel in my iOS project with the font

UIFont.monospacedSystemFont(ofSize: 17.0, weight: .regular)

I would like to create a label with exactly the same font in Launchscreen.storyboard. But Xcode's Attributes Inspector for this label offers me only the fonts "System" and "System Italic", not "System Monospaced". How can I make the font of my label in Launchscreen.storyboard match the font of the label in my app? I would be willing to open Launchscreen.storyboard "As Source Code" and edit the label's <fontDescription> element by hand, if I knew what to do. Thank you in advance.

As you know, you can't interact with Launch.storyboard by code. The only think you can do is using the interface builder provided by Xcode. The first thing you should do is finding and downloading the font you want ( http://iosfonts.com/ can help you). Than you should use the Xcode option that allows using custom fonts and than select your.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM