UIScrollView Not Scrolling?

前端 未结 6 880
无人共我
无人共我 2020-12-16 18:04

I have a UIScrollView created in interface builder with a bunch of UITextView and UIImageView objects already added. I have it connect

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 18:35

    This is a good walk-through of scroll-views in case anyone forgot after not using them for a while: https://medium.com/@pradeep_chauhan/how-to-configure-a-uiscrollview-with-auto-layout-in-interface-builder-218dcb4022d7.

    Basically, make sure you have view -> scrollview -> view, like so:

    then,
    1. Set scroll view constraint (top, bottom, leading and trailing) to (0,0,0,0).
    2. Set inner view constraint (top, bottom, leading and trailing) to (0,0,0,0).
    3. Set inner view to have equal width and equal height with parent view.
    4. Select height constraint of inner view and set priority to low (250).

提交回复
热议问题