Steve
Steve

Reputation: 11

How to resize text to fit a UITextField

I am trying to get text to resize automatically to fit a UITextField. I have the adjust to fit value set in interface builder but what happens when I build and go is the text goes from the default size, to the minimum size and never increases in size when less text is in the box.

I want to get text to work the way it does in apples iPhone calculator. How do I do this?

Upvotes: 1

Views: 3144

Answers (1)

August
August

Reputation: 12177

Text fields will never make text bigger. They will only reduce it in size from the default to the minimum size.

So, you need to change your defalt text size to be bigger.

Keep in mind that you're working with both a height and a width. Unless you have a square text field, no amount of adjustments will fill the field in both directions.

Upvotes: 2

Related Questions