ios - How to center view with autolayout -


i have universal app. subview rectangle positioned inside view.

how can keep centered , make automatically adopt it's width depends on screen width ?

e.g. enter image description here

as said want in portrait means not adaptive layout....so simple now....

as want width of object resize according screen width... pinned right , left edges of screen adopt width accordingly (or use equal width) not mention height...so give fixed height object....

and making object center of view controller ....
use center vertically , horizontally....and done..

here image of said better understanding

enter image description here


Comments