Reputation: 575
I am increase Textview height in propotion to parent view but font size remains same.
I would like to change the font size accoring to textview or screen size so it fills up the space in textview
The problem I am facing is in iPhone 4s it fills up the space while iphone 7s there are lots of empty space
is there any constraint we can use to achieve that other than doing programtically.
Upvotes: 2
Views: 189
Reputation: 77476
If you use a UILabel
instead of a UITextView
, you can set the Font Size to very large, with a small Minimum Font Scale
. Then, your text will "auto-size" to fit the view.
In this example, the Font is set to System 100.0
--- really, really big. Autoshrink
is set to Minimum Font Scale
with a value of 0.1
- or, 1/10th of 100, which is 10, and that's probably as small as you would want it to get.
While designing your view in Interface Builder, you will see the font size change as you change the size of the view.
Upvotes: 1