IPhone : Centering two adjacent elements using Auto Layout

on Saturday, February 21, 2015

I have a form in my iPhone app, and each row has a label and a text field, like this:



Username: ___________________

How old are you? __


What I want is for the row to be centered, preferably using IB and not code.


I've tried aligning the right edge of the label to the view's center, and the left edge of text field to the view's center, but that doesn't work when one of the elements is a lot longer than the other.


Thanks


0 comments:

Post a Comment