0

Let's say I have a NStableView column with ThisIsMyVeryVeryLongName header title. When I reduce the width of column by resizing, it usually shows like this ThisIsMyVery... (showing extra info is on the right side).

How do I change this to ...VeryLongName upon column width reduction.

(right alignment doesn't seem to work)

spt025
  • 2,134
  • 2
  • 20
  • 26

1 Answers1

0

On UILabel you can set Line break to Truncate Head. This will do what you need.

yourLabel.lineBreakMode = .byTruncatingHead

OneCommentMan
  • 147
  • 1
  • 6
  • `UILabel` and `NSTableView `? iOS or macOS? – Willeke Mar 22 '23 at 01:09
  • NSTableView is macOS, and UILabel is iOS – OneCommentMan Mar 23 '23 at 07:30
  • Does the header of `NSTableView` contain `UILabel`s? – Willeke Mar 24 '23 at 05:32
  • No macOS doesn't use UIKit , so UILabel isn't really an option (https://stackoverflow.com/questions/51517510/what-is-the-difference-between-appkit-and-uikit) . In my reply to the main question I had a feeling they were developing on iOS, so I suggested the UILabels lineBreakMode. Hope this helps, but I'm not too familiar with macOS – OneCommentMan Mar 24 '23 at 07:49