Handling custom selection style in view based NSTableView

后端 未结 2 2018
孤城傲影
孤城傲影 2020-12-18 08:42

How do I go about drawing my own custom selection style for a view based NSTableView? I tried putting a BOOL var in my NSTableCellView

2条回答
  •  盖世英雄少女心
    2020-12-18 09:13

    Alright, I figured it out. You just have to subclass NSTableRowView. It has methods for drawing the background for selected and deselected rows. To get the table view to use your subclass just implement the table view delegate method tableView:rowViewForRow: and return an instance of your subclass.

提交回复
热议问题