Change the 'Gravity' on a UIScrollView with Paging

江枫思渺然 提交于 2020-01-13 06:44:12

问题


Is it possible to change the 'gravity' (stop speed) when scrolling through a UIScrollView with paging enabled? I've implemented a horizontal UIScrollView that acts like the UIPickerView. I want to be able to scroll through many items based on the flick speed. Thanks!


回答1:


Unfortunately there's no simple property you can change to achieve this, but you can use the scrollview delegate methods to roll your own (it is somewhat complex, but achievable - I've modified table views to 'snap' to rows when the scrolling comes to an end).

Effectively, you'll have to code your own paging implementation.



来源:https://stackoverflow.com/questions/4974631/change-the-gravity-on-a-uiscrollview-with-paging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!