0

In a view there is a NSBox. I have to create different controls (Labels, TextFields, PopupButtons, Radio Buttons) based on data, and I want to place these controls in that box.

Suppose the data is like:

label: Name //name field is editable
label: PopupButton
label: Radio Button

And i'm getting xpos=2 and ypos=1 in the response (which means if we consider a box as a table we have to place the control in 2nd row 1st column).

So my question is: while placing these views in the NSBox, how to adjust the constraints? And if we are editing any thing in the TextField how to adjust the remaining views?

insys
  • 1,288
  • 13
  • 26
Suneetha
  • 67
  • 5
  • 1
    Are you asking how to create a constraint programmatically? (That seems to be explained pretty well in the docs.) Or are you asking what constraints you should create? (That seems like something that you can answer better than we can, as it depends entirely on how you want the items to be arranged and constrained.) Perhaps you could clarify the question. – Caleb Feb 20 '14 at 18:48

1 Answers1

0

If you need to create your layout constraints programmatically (sounds like you do) you should probably check out Apple's Auto Layout Guide and in particular

Creating Constraints Programmatically

There are some good WWDC videos covering auto layout as well that I'd highly recommend to get started on the topic (Auto Layout by Example in particular):

Jay
  • 6,572
  • 3
  • 37
  • 65