Unable to align label on segmented control in NSToolbar

As you can see from the screenshot, the text of the "View" button is aligned correctly in the "Allowed toolbar items" section, but as soon as I add it to the toolbar, it is aligned to the right. Why?

enter image description here

+4
source share
1 answer

You must set the minimum and maximum sizes for the toolbar item. I think you should also make sure that the authorization masks (or restrictions if you use auto-layout) are set correctly in the toolbar item view (in this case NSSegmentedControl). I don’t have the β€œright” settings, but the min / max panel element size is the correct auto-negotiation behavior here.

+8
source

Source: https://habr.com/ru/post/1383219/


All Articles