osx - Can not modify header cell of Table View -
my cocoa app has view-based table view.
the table displays week of calendar, each column day (say) sunday saturday.
i highlight column corresponds "today" in way; ideally, give colored background textfield, rounded corners; this:
(this trivial achieve in ios. on macos, cells etc. instead of views , layers, seems more complicated...)
however, not able change header cell's text or background color. code below (swift 3) is executed, column headers displayed default colors :
let columns = tableview.tablecolumns // (currentweek array of nsdate) (index, day) in currentweek.enumerated() { let column = columns[sundayindex + index] if shared.calendar.isdateintoday(day) { // these 2 lines executed, but... column.headercell.textcolor = nscolor.red // ...no effect column.headercell.backgroundcolor = nscolor.black // ...no effect } // works every row: column.headercell.stringvalue = formatter.string(from: day) }
Comments
Post a Comment