I need to get this appearance of NSSearchField

But it seems to be impossible to set backgroundColor with standard methods of Interface Builder. How i can achieve this? Subclassing NSSearchField and NSSearchFieldCell didn't help, because i loose all animations (when you click on search field and icon+text sliding to left) when implementing my own draw methods.
What your screenshot shows is just the standard look of NSSearchField when being placed under an NSVisualEffectView. That is, the search field will automatically get the look above when it's a subview of NSVisualEffectView (with the material of NSVisualEffectMaterialLight).
However, if you want this appearance without NSVisualEffectView, you can manually set its appearance:
searchField.appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantLight];

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With