Nstableview user group

I am creating a table view based on the view, and I'm having trouble creating a custom group. I want to have text in my group, and the default behavior that Apple provides is great, but I need to change the color and appearance of the actual string. I have subclassed NSTableRowViewand it works, but unfortunately not very well. In particular, when he begins to swim, I did not understand how to change the alpha representation without changing the alpha text as well.

+3
source share
2 answers

This is actually pretty easy. Create a new subclass of NSTableRowView and override the drawRect: method. Better to always call [super drawRect: dirtyRect]; at the beginning. Then you have the self.isGroupRow property. If so, just draw your own group of lines.

You can load in a custom Row in a Table View delegate using the tableView: rowViewForRow: method. Just return a copy of it right there.

+4
source

If I understand your question correctly, this solution should work for you:

Draw a custom NSTableRowView depending on whether the next row of the group

0
source

All Articles