At certain points in my app's lifetime I want to slot in a temporary 'overlay view' that sits on top of all of the content contained with the window's contentView
. I add this view as the last subview of the contentView
and give it a partially transparent red color. The problem is, for reasons I don't understand, the scroll views within the view hierarchy don't appear to be covered by this overlay.
In this screenshot everything (aside from the window decorators) should be covered by the red overlay view, but the scroll views clearly aren't:
What's going on? What is it about Cocoa's drawing routines that means scroll views don't behave like other views in this situation, and what can I do about it?