开发者

iOS App Portrait and Landscape Views

I'm trying to make and iOS app with both portrait and landscape views, but if I open it and change the orientation to Landscape, some buttons got offscreen, after going to IB 开发者_StackOverflow社区and reordering the buttons, in Portrait they go off screen.

After googling, I dont have ANY ideia how to 'change' views according to orientation.

Could you guys give me some help? Ah, also, Apple Support Documents seems pretty useless to me :P

Thanks!


There a method

 - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{}
which is useful in such cases.


You should change autosizing properties in IB (they're in the same place where frame size is) or change autoresizingMask properties of your inner views and controls programmatically. This controls what happens to the elements of your screen after it gets resized (for example when the screen is rotating). You can glue your components to left or right or both, top or bottom or both and similar. Play with it, it's pretty powerful and you don't need any code for that if what they can do is enough.

iOS App Portrait and Landscape Views

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜