Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't align label on a Segmented Control in an NSToolbar

As you can see from the screenshot, the View button text is aligned properly under Allowed Toolbar Items, but once I add it to the toolbar, it's aligned to the right. Why?

enter image description here

like image 606
janeh Avatar asked Nov 26 '11 18:11

janeh


1 Answers

You have to set sane minimum and maximum sizes for the toolbar item. I think you also have to make sure the autoresize masks (or constraints if you're using automatic layout) are set properly in the toolbar item's view (the NSSegmentedControl in this case). I don't have the "proper" settings handy but the min/max toolbar item size + correct autosizing behavior are the key here.

like image 80
Joshua Nozzi Avatar answered Nov 16 '22 07:11

Joshua Nozzi