I have a UILabel in my iPhone project that has a fixed width and height but it's content can vary depending what the user is looking at. Sometimes the text is to big for the UILabel and that is when the string: '...', gets added to the end of the line. I wonder if I could change this string to something else, for instance: '(more)'.
Thanks!
Unfortunately, it appears that such an option is not included on iOS, as per this similar question: How to change truncate characters in UILabel?
However, as the answers in the aforementioned question state, this can be easily done yourself. All you really need to do is find where the string gets truncated and subtract the amount needed for your chosen ending character(s). Then put the remainder in a separate string.
For this method, this answer would also be useful:
As Javanator said you would have to do your own truncation. You shuld use the sizeWithFont:forWidth:lineBreakMode: message on the UIKit additions to NSString class to get the width of a string with a certain font. This will handle all types of fonts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With