NSDocument toolbar major appearance problems in Big Sur

I have an NSDocument-based Mac app built for 10.14+, written in Swift.

Just updated my (intel) OS to Big Sur to test, and while the app builds and generally functions fine the document window toolbar is totally messed up when I run the app.

In particular:
  • only one toolbar item (Save) shows up on the toolbar in icon+text mode, the rest are all shoved into the menu, regardless of window size

  • same is true if I switch to Icon only mode

  • when I right-click on the menu bar to customize it in the app, everything is haywire - tons of blank space between titles and icons, some icons as you scroll down are huge, default set looks like it only contains one button

If I turn off icons and show only text toolbar items, they all show up properly on the toolbar.

In Xcode (12.2), the toolbar in the document .xib looks totally fine - all buttons and icons in the right place, default set looks great, etc.

There's nothing very custom about my toolbar - it's just using standard toolbar buttons with icons set from image assets, and a few separators between items. Default is visible, regular size, Icon+Text. All works perfectly under 10.14 and 10.15.

Anyone else seen this bizarre toolbar behavior under Big Sur? This is my app's last release-blocking issue!

Answered by ForumsContributor in
Accepted Answer
Solved: in the debugger output, Xcode warned about min and max sizes for toolbar items being deprecated.

After changing all toolbar item sizes to "Automatic", the toolbar items appear again, and the issues with the Customize panel are fixed.

Additionally, I was able to retain the existing separator-spacing of items by changing the toolbar type of the Window from "Automatic" to "Expanded".
NSDocument toolbar major appearance problems in Big Sur
 
 
Q