Placing and Moving Views on Rotation (UIView)

前端 未结 4 851
失恋的感觉
失恋的感觉 2020-12-28 08:40

What\'s the \"correct\" way of exactly placing and moving views when an app rotates? That is, how can I have fine-grained control of the position, size, and reflow of my vie

4条回答
  •  误落风尘
    2020-12-28 09:19

    There is a lot solutions for that. One of them is animations for controls as you read before. Another option is prepare 2 UIView one for portrait mode and another for landscape mode. And on switch orientation - load proper UIView. That's the way i used in my applications. Because sometimes differences between landscape and portrait is huge.

    In simple cases is enough to set up correct autoresizingMask for subviews. Read about it. It works really nice.

提交回复
热议问题