Justin Copeland
Justin Copeland

Reputation: 1951

How do I ensure that the text of my UIButton is not shortened?

I changed the text of my UIButton to a long equation. Unfortunately, my text is shortened.

enter image description here

How do I prevent shortening? It shortens my text even when I specify "Clip" or "Word Wrap" in the Nib.

Upvotes: 0

Views: 134

Answers (1)

Mike Z
Mike Z

Reputation: 4111

Call these two methods and your button will automatically adjust to the size of the text:

[myButton sizeToFit]; [mybutton setNeedsDisplay];

Upvotes: 1

Related Questions