开发者

How to limited the UIScrollView Scroll width?

开发者 https://www.devze.com 2023-01-12 15:38 出处:网络
开发者_运维知识库I want the UIScrollView scroll 50 px each time, how can I limited it? thank you. This depends on how you want the effect to work. Implementing UIScrollViewDelegate will give you infor
开发者_运维知识库

I want the UIScrollView scroll 50 px each time, how can I limited it? thank you.


This depends on how you want the effect to work. Implementing UIScrollViewDelegate will give you information when the user scrolls which should allow you to get whatever you are after. I did a similar thing where after the user scrolled I would move the content offset so that my button would always be in the middle.

For this I overrode scrollViewDidEndDragging and called setContentOffset to scroll to where I wanted.

0

精彩评论

暂无评论...
验证码 换一张
取 消