Different layouts in portrait and landscape mode

后端 未结 9 1669
别跟我提以往
别跟我提以往 2020-12-28 14:16

Let\'s assume I have this layout design on an iPad Portrait.

But I would like to have it this way when the iPad is in landscape:

Is it possible to

9条回答
  •  天涯浪人
    2020-12-28 15:06

    it is much easier to put those two views in a stack view and change the axis orientation for the stackview.

    1. create a IBOulet reference to the stackview
    2. implement viewWillTransitionToSize
    3. change the axis for each orientation by doing self.stackView.axis = .vertical or .horizontal

提交回复
热议问题