iOS center button on rotations -


i have uiview subview of uiview. within uiview have button want centered. problem running that, since subview can change sizes upon rotations, button gets off centered. there way auto-centering?

try setting button center uiview center this:

[mybutton.setcenter:mysubview.center]; 

and set autoresizing mask:

[mybutton setautoresizingmask:uiviewautoresizingflexibleleftmargin | uiviewautoresizingflexiblerightmargin]; 

hope helps.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -