In my app i want to set text field width according screen size in landscape mode,using auto layout.it's working portrait perfectly in land scape mode not working.
Here is my Screen with auto layout,
In landscape mode showing like this,
Here is my Constraints Screen
this my View Controller
I suppose you must have some superview under this layout that has explicit width set.
How does it look like when you tweak simulated metrics like size and orientation in your storyboard?
Alse remember to double check the view hierarchy.
Check the size inspector, your contraints should be:
trailing space to superview, leading space to superview, and some top and bottom space. And don't set explicit width value
EDIT: As you can see, the view which is the superview for your textfields and actually whole layout, has the explicitly set width value. Delete this value and instead set both trailing and leading space. This would work
Constraints for scrollview - leading, trailing, top and bottom and equal width to superview.
Constraints for view inside scrollview - leading, trailing, top and bottom to scrollview and equal width to scrollview.
And the constraints given to textfields, buttons, etc. are correct. You just need to revise scrollview's and view's(inside scrollview) constraints.
Don't need to set Centre constrain. Just set top , Leading and Trialing . so, Autolayout Adjust size automatically. check below image ,
Check Output :-
EDIT :-
Here i have attached Demo with Scrollview . check it.
Constrain with scrollview
Output :-