开发者

NSTableColumn auto resize only the first column

I have an NSTableView with 4 columns. I want to change the auto resizing properties of the first NSTableColumn. If the user resizes the app, only the first column is allowed to change his wi开发者_StackOverflowdth. My code :

// First 3 columns similar to the 4th one.
NSTableColumn*  Column4     = [[[NSTableColumn alloc] initWithIdentifier:@"Column4"] autorelease];
[[Column4 headerCell] setStringValue:@"-"];
[Column4 setWidth:15];
[tableView addTableColumn:Column4];
[tableView setDataSource:self];

As you can see, the columns are added programmatically.

Thanks!


Added this line and it worked :

[TableView setColumnAutoresizingStyle:NSTableViewFirstColumnOnlyAutoresizingStyle];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜