Android SimpleOnScaleGestureListener 缩放启动
我有一个通过 View
实现的 SimpleOnScaleGestureListener
,每当我将两个(或更多)手指放在屏幕上时,它就会注册一个 缩放手势
开始了。实际上,我希望当手指移动时开始缩放手势,而不是当手指在屏幕上向下时开始。
我如何知道真正的缩放已经开始? onScaleBegin
和 onScaleEnd
还记录了当手指在屏幕上向下时开始缩放,而不是像我预期的那样在手指移动时开始缩放。
I have a SimpleOnScaleGestureListener
implemented over a View
, and whenever I put two (and more) fingers on the Screen, It registers that a Scale gesture
begun. Actually, I want the scale gesture
to begin when the fingers are moving, not when they are DOWN on the screen.
How can I tell the real scaling begun? The onScaleBegin
and onScaleEnd
register also that the Scaling begins when the fingers go DOWN on the screen, not when they're moving just as I expected.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,当第二根手指触摸屏幕时,将调用
onScaleBegin
。您需要的是覆盖onScale
- 当您开始移动手指时触发。您还可以保留 onScaleBegin 参数中的 detector.getScaleFactor 的初始值,并在该值发生变化时采取行动,但这会更复杂。By default,
onScaleBegin
is called when the second finger touches the screen.What you need is to overwriteonScale
- that fires when you start moving your fingers. You can also keep the initial value ofdetector.getScaleFactor
fromonScaleBegin
's parameter and act when that changes, but that would be more complicated.