UIScrollView not scrolling in Swift

前端 未结 12 1024
Happy的楠姐
Happy的楠姐 2021-02-03 19:03

My UIScrollView won\'t scroll down. I don\'t know why. I already followed Apple documentation regarding to this issue.

@IBOutlet weak var scroller: UIScrollView!         


        
12条回答
  •  闹比i
    闹比i (楼主)
    2021-02-03 19:29

    If you are using Storyboard:

    1. Put your Content view inside the UIScrollView
    2. Add top, bottom, left and right constraints with the scroll view
    3. Add equal heights and widths constraints
    4. For a vertical scroll set the Equal Heights Constraint priority to 250. For a horizontal scroll set the Equal Widths Constraint priority to 250

提交回复
热议问题