On May 20, 2016, at 03:56 , Ulf Dunkel <email@hidden> wrote:
In English, everything looks fine, and most other languages are auto-layouted fine, too. But when you compare it e.g. with Spanish, you'll see that some things aren't properly auto-layouted on runtime, although they are in the Assistant Editor.
It looks like the window sizing is taking precedence over some of the horizontal spacing. IIRC, the assistant editor shows the sub-hierarchy starting from the selected view, which means it won’t reflect the effects of autolayout on the window itself. My guess is that you either have an error in the constraints for the contents of the boxes, or you have an ambiguity (or error) in the priorities relative to the priority of horizontal window resizing.
I really wonder if the issue is founded in the "Translates Mask Into Constraints" checkbox which is set for the main NSView: -[NSView setTranslatesAutoresizingMaskIntoConstraints:].
Huh? Why are you setting this, ever, if you’re using autolayout? (Other than in an attempt to control a layout going haywire, to which problem this is not the correct solution, on the face of it.)
Is this an app where you can use NSStackView? IIRC, it was introduced in 10.9, and dramatically improved in 10.11. If you can, I’d suggest you try laying this out with nested stack views. (However, the 6 text fields and aligned labels are bit hard to lay out properly with stack views. For those, I’d suggest manual constraints on 2 new custom subviews of the boxes. Everything else looks like it would be easy in stack views.
I must admit, I had trouble with autolayout using NSBox, in part because it now seems to have an intermediate view between the box and the contents. I ended up going with a “flatter” design that didn’t use the boxes. |