How can I change the color of a cell in my NSTableView?
相关问题
- NSOutlineView drag line stuck + blue border
- How to change default background color for TChromi
- iphone sdk see size of local file (one created
- Change background color of row extjs4
- How can you detect the connection and disconnectio
相关文章
- Set color of 'empty' area of ListView in A
- Converting (u)int64_t to NSNumbers
- “getter” keyword in @property declaration in Objec
- NSMenuItem KeyEquivalent “ ”(space) bug
- Detect if cursor is hidden on Mac OS X
- NSNumberFormatter doesn't allow typing decimal
- Is subclassing NSNotification the right route if I
- Changing background color for a text annotation to
Try using a custom
NSView
for that, orNSTableView
's-setBackgroundColor:
method.In your
NSTableViewDelegate
for theNSTableView
, implement this method:The
NSTableView
calls this on its delegate before displaying each cell so that you can affect its appearance. Assuming you're using NSTextFieldCells, for the cell that you want to change call:Or, if you want to change the text color:
If you want columns to have different appearances, or if all of the columns aren't NSTextFieldCells, use
[tableColumn identifier]
to, er, identify the column. You can set the identifier in Interface Builder by selecting the table column.// TESTED - Swift 3 solution...for changing color of cell text in a single column. All columns in my tableview have a unique identifier