UIScrollView + Centered View + Ambigous Scrollable Content Size + many iPhone sizes

前端 未结 3 1998
暗喜
暗喜 2020-12-24 12:43

I have:

  • application, that should work in landscape and portrait mode.
  • view with full-size scroll view on top.
  • some view inside scroll view wi
3条回答
  •  清歌不尽
    2020-12-24 13:38

    There seems to be a lot of confusion on this issue. My take is that a UIScrollView must have TWO trailing space constraints, an 'inner' one connecting it to one of it's subviews (so it can know its content width), and another 'outer' one connecting it to a sibling or superview so it knows its frame width.

    Same principle applies for height, i.e. two bottom space constraints.

提交回复
热议问题