NSTableHeaderView print in dark mode

I have updated my app to support dark mode and it's working everywhere now, except for printing. I have an NSView to print. In order for most controls to print correctly, black on whitebackground, I have done this:

[control setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];


The only portion which still prints dark on dark is the table headers. How can I set the headers to print black on white?


I have set the table view itself to NSAppearanceNameAqua and the rest is ok.

Accepted Reply

OK, resolved it. Didn't need any of the previous code. Just selected the view controller's view in IB and set the appearance to Aqua.

Bingo.

Replies

BTW, I have also added this:

[self.itemsTableView.headerView setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];


and this:

    for(NSTableColumn * tTableColumn in self.itemsTableView.tableColumns){
        [tTableColumn setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
    }


setAppearance is not available of NSTableColumn

OK, resolved it. Didn't need any of the previous code. Just selected the view controller's view in IB and set the appearance to Aqua.

Bingo.

Of course.


setting in code or in IB does exactly the same. That’s not really a different solution.