use autolayout and everything will be done automatically. enter image description here. if not autolayout ...
stackoverflow.com