tags:

views:

22

answers:

1

I have a simple view-based app from that template. It has nothing else in there, only one UIButton.

When the device rotates, I want that button to be re-layoutet in such a way that it fits the width of the screen automatically. It has a margin of 20 points left and right, which should always remain the same.

+1  A: 

I am not sure what template you are referring to. But if you are adding the UIButton in Interface Builder, take a look at the inspector. What you would need to do is to make sure your UIButton autosizing struts and springs are properly set. There is a preview button that will show you how the button will be autosized if the view changes.

Shiun