Hiding NSTableView header?

前提是你 提交于 2019-11-30 06:02:31
Brian Webster

In Interface Builder, select the table view, open the attributes inspector (alt-command-4), and uncheck the "Headers" checkbox in the "Columns" section.

You can also set the headerView programmatically without subclassing

[tableView setHeaderView:nil];

To do this programmatically, you can subclass NSTableView (or any NSTableView child class) and return nil for the headerView variable:

@interface AppTableView : NSTableView {

}

@end

@implementation AppTableView

- (NSTableHeaderView *)headerView{
    return nil;
}

@end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!