Disable vertical scroll in UIScrollView Swift

前端 未结 8 966
鱼传尺愫
鱼传尺愫 2021-02-15 00:47

(Don\'t mark this question as duplicated. I read a lot of questions but I don\'t find the answer to my issue.)

My issue is the following: I have a UIScrollView

8条回答
  •  长情又很酷
    2021-02-15 00:59

    just set the contentOffset in scrollViewDidScroll

    if scrollView.contentOffset.y > 0 {
        scrollView.contentOffset = CGPoint(x: scrollView.contentOffset.x, y: 0)
    }
    

提交回复
热议问题