vishal dharankar vishal dharankar - 1 year ago 73
iOS Question

How to auto layout labels and textfields horizontally iOS

I have two textfields and labels in a row and I want them to stretch in proportion when orientation changes to landscape.

enter image description here

Here are the constraints

enter image description here
enter image description here

With current constraints I am getting following output

enter image description here

Notice how only the label was stretched.
I am not sure what additional changes are needed to the layout.

Answer Source

Right click on label that you've selected in above shown image and drag the mouse pointer to the its superview you got op up smthg like below and select equal width.

enter image description here

When you done above step your component is streched to whole view so dont panic now select your component again and open size inspector. click on width constraint you got below screen

enter image description here

Now change the multiplier like this

enter image description here

Do same for all components and give multiplier as what width you wanted to set. It automatically works for you in all screens iPad and iPhone and all orientations.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download