How to change truncate characters in UILabel?

前端 未结 5 706
野趣味
野趣味 2020-12-03 19:31

When the text of a UILabel gets truncated there are 3 dots inserted by default. Is it possible to change these characters or disable them?

5条回答
  •  广开言路
    2020-12-03 20:28

    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.

    Link

提交回复
热议问题