In autolayout, how can I have view take up half of the screen, regardless of orientation?

后端 未结 5 547
萌比男神i
萌比男神i 2021-01-31 09:41

In portrait mode, I have a tableview on the left-side, and a webview on the right-side. They both take half of the screen. I have autolayout enabled.

But when I rotate t

5条回答
  •  礼貌的吻别
    2021-01-31 09:59

    Bind both of them to the superview edges (table view to the leading edge, web view to the trailing edge) and set constraint for them to have same width.

提交回复
热议问题