Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的情况下,该方法scrollViewDidEndDecelerating可以检测到水平滚动UIScrollView,我想知道如何检测对角线或垂直滚动。
scrollViewDidEndDecelerating
UIScrollView
要检测滚动的方向,例如 scrollViewDidScroll:,请查看 scrollView.contentOffset.x(水平)和 scrollView.contentOffset.y(垂直)与之前的值相比有何变化。如果他们都改变了,那么它是一个对角滚动。