Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I handle long text labels on a universal storyboard?

If the text of a label in a universal storyboard is too long to fit some resolutions, how do I accommodate it?

Storyboard View

Storyboard View

iPhone 6 Emulator

iPhone 6 Emulator

I'm not sure if there is a proper way to go about this according to the guidelines, but I would assume I would either text wrap onto multiple lines or adjust the font size automatically.

like image 381
Christopher Markieta Avatar asked Dec 05 '22 03:12

Christopher Markieta


2 Answers

Here is a simple gif, which can help you to understand it better.

enter image description here

like image 52
Sandeep Avatar answered Feb 08 '23 23:02

Sandeep


You can do either. First set the constraints so that the UILabel does not go past the edge of the screen. Then you have two options. Either set the minimum font size of set the number of lines to 0 (or both).

All of these settings can be set in storyboard.

Edit to following your comment

Constraints are usually set in the storyboard and dictate how a view is drawn based on the device you are using. It's a large and critical subject and Ray Wenderlich has a very good two part tutorial on it.

like image 30
Mika Avatar answered Feb 09 '23 00:02

Mika