View-based NSOutlineView header cell font issues

前端 未结 2 1495
耶瑟儿~
耶瑟儿~ 2021-02-09 23:39

I\'m currently trying to use a new view-based NSOutlineView in my Cocoa app. As I\'m not using bindings, so I implemented all required delegate and datasource methods in my cont

2条回答
  •  温柔的废话
    2021-02-10 00:34

    You need to implement the -outlineView:isGroupItem: delegate method and return YES for your header rows. That will standardize the font and replace the disclosure triangle on the left with a Show/Hide button on the right. You will still need to manually uppercase your string to get the full effect.

    I'm not sure if the group row delegate method above makes the selection style look okay or not. However, you normally don't want the header rows to be selectable at all in source lists, which you by returning NO for header items from the -outlineView:shouldSelectItem: delegate method.

提交回复
热议问题