How can I have the only column of my NSTableView take all the width of the TableView?

前端 未结 3 1848
眼角桃花
眼角桃花 2021-02-01 01:57

I am currently trying to learn a bit of Cocoa (using the book Cocoa Programming for Mac OS X). In one of the exercises, we set up a NSTableView with only one column, to act as a

3条回答
  •  忘了有多久
    2021-02-01 02:34

    Here's how I did it in Xcode 4.6...

    In IB, select the table view and go to the Attributes Inspector. Choose 'Uniform' for 'Column Sizing'. Then, select the table column and choose 'Autoresizes with Table' for 'Resizing'.

    These options correspond to:

    [tableView setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle];
    [tableColumn setResizingMask:NSTableColumnAutoresizingMask];
    

提交回复
热议问题