pt2ph8 pt2ph8 - 1 year ago 159
iOS Question

UIButton's Title Label Word Wrap with Tail Truncation

I need to enable word wrapping and tail truncation, at the same time, on a

. Setting numberOfLines to something more than 0 doesn't work, the text stays on one line.

I've already searched around and haven't found a solution. Any idea?

Answer Source

I solved it the same day I posted this question by putting a UIButton on top of a UILabel with numberOfLines set to 3. I had left this unaccepted to see if someone had a better idea, but apparently there's no other solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download