How can I set blue background for every second row in NSOutlineView, like it does Finder.app?
Asked
Active
Viewed 135 times
2 Answers
0
You can subclass NSOutlineView and do some drawing in
- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect
Also have a look at other drawing methods available in TableView. You can also make use of the delegate method i.e
- (void) outlineView:(NSOutlineView*)view willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn item:(id)item

nkongara
- 1,233
- 8
- 14
0
NSOutlineView
is a subclass of NSTableView
and thus inherits the method setUsesAlternatingRowBackgroundColors:
If you send a YES to it, you get alternating background colors.

Volker
- 4,640
- 1
- 23
- 31