Oleksandr Matrosov
Oleksandr Matrosov

Reputation: 27113

UILabel cutting off symbol

Hello!

How to get text (string) in my UILabel. What I mean? I set a text for my UILabel programmatically. But if my text very large the text don't fit to my label and UILabel cutting off this text.

How I can to check new text with a cutting symbol?

For example:

Source: 'Some Large Text'

Cutting text: 'Some Large T...' (need to get this string)

Thanks for response!

Upvotes: 1

Views: 1290

Answers (1)

pmk
pmk

Reputation: 1897

You have to set the UILabels's property linebreakemode and number of lines:

label.numberOfLines       = 2;
label.lineBreakMode       = UILineBreakModeWordWrap;

aditionally you might need to set the frame correctly. cheers

Upvotes: 1

Related Questions