UIScrollView not scrolling in Swift

前端 未结 12 1064
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条回答
  •  广开言路
    2021-02-03 19:25

    If you use AutoLayout,

    Set content size in viewdidAppear which works for me.

    override func viewDidAppear(_ animated: Bool) {

        scrollView.contentSize = CGSize(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height+300)
    
    }
    

提交回复
热议问题