How to achieve visual consistency between NSComboBox and NSTextView on sidebar

Do you have any ideas on how to make the background color of a NSTextView the same as the background of a NSComboBox when both are on a sidebar?

The closest I could get is using a NSVisualEffectView, but it's still not optimal (the text view is slightly darker)

override init(frame: NSRect) {
    self.scrollView = NSTextView.scrollableTextView()
    if #available(macOS 26.0, *) {
        scrollView.borderType = .lineBorder
        let backgroundView = NSVisualEffectView()
        backgroundView.material = .contentBackground
        backgroundView.blendingMode = .withinWindow
        backgroundView.state = .followsWindowActiveState
        backgroundView.translatesAutoresizingMaskIntoConstraints = false
        self.materialBackgroundView = backgroundView
    } else {
        self.materialBackgroundView = nil
    }
...

I'm not exactly sure the goal you have in mind. It sounds like NSComboBox has the background appearance that you want and you're trying to get NSTextView to have a similar background. Have you tried just using a multi line NSTextField instead of full NSTextView?

Yes, NSComboBox has the desired background appearance (at least this is the one that's most difficult to change, so I'm taking this as the base).

I want to use a NSTextView because of its scrolling capabilities and would love to have a consistent look of the controls on the sidebar.

I achieved this with different workarounds with the help of a NSTextField pre-macOS 26. But with Tahoe, lots of the visuals of controls on the sidebar changed and I'm looking for a solution to make it visually more consistent.

Edit: Here is the feedback ID related to this from last year: FB18025262

Some screenshots of how the NSTextView is rendering would be helpful. I think the issue might be that both NSScrollView and NSTextView are both drawing backgrounds so try clearing them and see if that makes a difference.

scrollView.drawsBackground = false
textView.drawsBackground   = false
textView.backgroundColor   = .clear

Clearing the background makes the text view use the sidebar background.

This is what I currently have with the NSVisualEffectView from above

Now that I look at it, it's not so different at all. But still quite different from the NSComboBox background.

The images are helpful. I think this is less complicated than I was thinking it might be and all you need to do is configure the scroll view's border type and set a background color on the text view. Hopefully this is closer to what you are looking for.

scrollView.borderType = .bezelBorder        // not .lineBorder

textView.drawsBackground = true
textView.backgroundColor = .textBackgroundColor   // bright white, like the combo fields

Thank you! I've tried various combinations of this already and if I change it like that, the text view is always brighter than the combos (especially in disabled state).

This is from a test app that has NSComboBox, NSTextField, and NSTextView on a sidebar running on macOS 27 beta 1.

How to achieve visual consistency between NSComboBox and NSTextView on sidebar
 
 
Q