How to custom the focus ring color of NSTextField?

283 Views Asked by At

I have a custom NSTextField, named MySearchField. When I put it on the top of NSVisualEffectView and run my app on macOS 11.x, ring focus color of the text field and background color of selected text both turns white.

It seems that there is no API to adjust this in Apple API Reference. But I found the style of search field on Mac App Store is what I want.

So, How should I solve this problem? Any help will be appreciated!

EDIT

Accent color seems to cause this problem. In this case, multicolor is selected. How to specify an accent color for NSTextField?

0

There are 0 best solutions below