Truncate beginning of label

后端 未结 2 941
孤城傲影
孤城傲影 2021-01-23 23:44

I have a label (NSTextField) with text aligned right. When the text becomes too large to display, the end of the text is truncated (at the right edge of the label).

2条回答
  •  野性不改
    2021-01-23 23:55

    I'm not quite sure if this works for NSTextFields, I know it does for UILabels, but have you tried :

    myTextField.lineBreakMode = NSLineBreakMode.ByTruncatingHead
    

提交回复
热议问题