简体   繁体   English

使用分页更改UIScrollView上的“重力”

[英]Change the 'Gravity' on a UIScrollView with Paging

Is it possible to change the 'gravity' (stop speed) when scrolling through a UIScrollView with paging enabled? 在启用分页的UIScrollView滚动时是否可以更改“重力”(停止速度)? I've implemented a horizontal UIScrollView that acts like the UIPickerView . 我实现了一个水平的 UIScrollView ,其行为类似于UIPickerView I want to be able to scroll through many items based on the flick speed. 我希望能够根据滑动速度滚动浏览许多项目。 Thanks! 谢谢!

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). 不幸的是,您没有可以更改的简单属性来实现此目的,但是可以使用scrollview委托方法来滚动自己的属性(虽然有些复杂,但可以实现-我已经修改了表格视图,以便在滚动到结束)。

Effectively, you'll have to code your own paging implementation. 实际上,您将必须编写自己的分页实现代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM