how do I use UIScrollView in Interface Builder?

后端 未结 17 1448
遇见更好的自我
遇见更好的自我 2020-11-28 19:52

While I\'ve used UIScrollView successfully in the past by manipulating it programmatically, I\'m having trouble getting it to work by setting it up exclusively

17条回答
  •  天命终不由人
    2020-11-28 20:20

    1. Add UIViewController
    2. In UIViewController 'Attribute Inspector -> Simulated Metrics' set size Freeform
    3. In UIViewController 'Size Inspector -> View Controller' set height 800
    4. Add UIScrollView in UIViewController
    5. Add all constraints to UIScrollView (top, left, right, bottom) and add alignment X = center
    6. Add UIView in UIScrollView
    7. Add all constraints to UIView (top, left, right, bottom) and add alignment X = center. Yes, same as for UIScrollView in #3, but for UIView
    8. Add height constraint to UIView. For example 780
    9. Run

提交回复
热议问题