Different font sizes for different devices in Xcode 6

I want to use the same text on different devices. I use a universal storyboard, but I can not find any restrictions on the font size. I know that you can use different text fields on different devices with a new layout, but then I need to add some logic to the code. I want to use the same text box.

+4
source share
1 answer

Select your text box in your storyboard. In the attribute inspector, you will see a small “+” to the left of the font selector. This will allow you to select a class-specific material size for your text.

Class levels were added in iOS 8 when Apple introduced Universal Storyboards, which allow you to create both iPad and iPhone with the same storyboard file. At the bottom of the storyboard design window, you will see the "w any h Any" button (default). This gives you access to combinations of compact and regular class sizes. These available combinations allow you to implement a design, say, only for the iPhone in the landscape or, possibly, the iPad in both orientations. You have full control.

For your font-related question, you are accessing the dimension class control via the "+" sign mentioned above.

This is a good explanation and tutorial: Wenderlich size classes

and in Apple's own words: Apple size classes

EDIT: - If you really want to have different font sizes for different screen sizes, then this answer will help you.

+14
source

Source: https://habr.com/ru/post/1243911/


All Articles