how to move one direction in UIScrollView when scrolling

前端 未结 2 1496
感情败类
感情败类 2021-01-21 00:50

I\'m new in objective-c. I create UIScrollView object and add in my view with this code:

height = self.view.frame.size.height;
width = self.view.fra         


        
2条回答
  •  青春惊慌失措
    2021-01-21 00:55

    If i understood you right, you want to disable scrolling in the direction that has been dragged less by the user. If so, UIScrollView already offers an option to do so:

    scrollView.directionalLockEnabled = YES;
    

    When this option is set to true UIScrollView will handle the correct direction lock by itself.

    For more information look at the documentation: link

提交回复
热议问题