Pregunta

I have a view with these subviews, listed from the top down: An NSTextfield A, an NSMatrix, another NSTextfield B.

I use auto layout constraints in IB to horizontally center textfield A above the matrix. The vertical space above the textfield is set to "Equal" and the and the vertical space between it and the matrix is also set to "Equal". Textfield B is centered below the matrix and the vertical space between it and the matrix is set to "Greater than or Equal". It is also horizontally centered below the matrix, but there is no constraint on the vertical space below it.

The matrix can take a variable number of cells and what I want is that when a cell is added to the matrix, it "grows" downward, but what happens, given the constraints listed below and any others I've tried, is that it "grows" upward, vexing me tremendously. What I would expect to happen, given the above constraints, is that the matrix would grow downward, pushing textfield B down and forcing the view to grow.

Can someone enlighten me as to what I need do to make this work. Thanks

¿Fue útil?

Solución

Make a containing view with flipped coordinates. It should override isFlipped: to return YES

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top