Repositioning controls when the orientation changes

后端 未结 5 423
醉酒成梦
醉酒成梦 2021-02-04 09:01

I know Auto Layout can be used to make the sizes and position consistent when the orientation changes. Is it possible to completely change the layout when the orientation change

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 09:19

    In your case it can be achieved by two methods, instead of reframing every component you can group the controls like the following..

    1. Parent View -> User Info View -> All User Info controls.. By doing this you will have to just reframe the User Info View not all the controls..

      Then only Logo and Company name left to reframe.. Total 3 controls to reframe if you group your controls..

    2. Create two views one for Portrait and other for Landscape mode, and just add and remove on rotations.. this is the fastest way as you won't have to readjust the frame by tedious code.

    Hope above helps.

提交回复
热议问题