EDIT: I still have not gotten this to work. Would someone mind downloading my simple test project and trying it on their machine? There's just boilerplate code and a storyboard.
https://www.dropbox.com/sh/qtoqhi7pjq5w3hh/AADLCTY_7FPG18RWeSe57Jroa?dl=0
ORIGINAL QUESTION: I’m developing a macOS app for Big Sur. I want to take advantage of the blur effect of the window bar over my content. I have set the fullSizeContentView
mask on the window. However, I can only get the effect to work when I have set a minimal amount of spacing between the scrollview’s leading edge and its superview’s leading edge. This seems to be a bug in AppKit. Can anyone confirm or tell me what I’m doing wrong?
See below clips:
First I have a simple Xcode project (no code, just using the Storyboard). Scroll view is setup in the content view of the view controller. The Scroll View has no spacing to its superview for its top, trailing and bottom edges. The leading edge has standard spacing (20pt) to its superview’s leading edge.
This works as expected, but I don’t want the the leading edge spacing. So I set the leading edge spacing to 0.
Update: It seems that this 'issue' has been fixed in macOS 12 beta 5.
The code below may still be useful for macOS 11.
Nowadays macOS is overcrowded with small weird 'issues' and this seems to be one of them. In most cases these issues are only solvable by applying weird solutions, because we don't have access to the inner parts of AppKit.
if let constraint = view.constraints.first(where: { $0.firstAttribute == .leading }) {
constraint.constant = -0.3
}
Applying a small negative leading constraint seems to solve the problem for now. Can be done in code, and theoretically also in the Storyboard, although it's hard to enter and store decimal values in interface designer.