I have a Mac app with a search field in its toolbar (actually a NSTextField
, but I tried NSSearchField
as well).
My problem is that the text field background on Big Sur is just plain white, which makes it hard to recognize.
Safari's location bar on Big Sur has more contrast. I believe this is somehow achieved by using vibrancy (How to change background color of NSSearchField (like in Messages app in OS X)), but I cannot get the same effect.
I tried:
testTextField.appearance = NSAppearance(named: .vibrantLight)
- various combinations of drawing/not drawing backgrounds
- various background colors
- wrapping my toolbar item into
NSVisualEffectView
, but that shows around the text field
Edit:
I should mention that I use roundedBezel
border style. This alone seems to affect the background color (i.e. background is always white, no matter which color was set).