4

I use an NSVisualEffectView in my Cocoa app. My problem is that text in a text field above the visual effect view looks slightly bold/blurry if the visual effect view itself is wrapped in another NSView (see label #3 in the screenshot below).

My view hierarchy looks like this:

- Window Content View
    - NSView
        - NSVisualEffectView
    - NSTextField (placed so that it shows above the visual effect view)

Or as screenshot:

View Hierarchy

Here is what the window looks like:

Window with problem

Notice how the third label looks slightly bold? That's the one above the view that wraps the visual effect view.

I tried overriding allowsVibrancy to return false in my text field, but that did not work.

Why I need this view arrangement in the first place:

I want to use the text field for a custom window title. The visual effect view is part of the content view, which can change depending on the state of the app. The title text field, however, will always show (that's why it is at the top level).

Mark
  • 6,647
  • 1
  • 45
  • 88

0 Answers0