My app has an NSToolbar
with a horizontal NSSplitView
below it. An NSSegmentedControl
in the toolbar moves with the splitview's divider, just like the one in OS X's Finder. NSLayoutGuide was used to align the two "views" from different storyboard "scenes". I shared this approach in this related question.
However, I don't know how to move the label with the icon. I've set the minSize
and maxSize
, but the label is fixed. In the first screenshot below, the "View Mode" label is not right below the segmented control.
It will be easy to add constrains to the label if I can access it. But I haven't found the API in NSToolbarItem, which only has a public view
property. I've examine the view's hierarchy (the second screenshot), but I don't think I should use the variables with the _
prefix.
A related but different question is here. That question doesn't take moving into account.