如何在 Android MapView 中禁用捏合 [英] How to disable pinch in Android MapView
本文介绍了如何在 Android MapView 中禁用捏合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 Android MapView 中禁用捏合或多点触控功能?
How can you disable pinch or multitouch functionality in an Android MapView?
推荐答案
我花了一点时间,但我有一个解决方案.我所做的是在不止一根手指触摸屏幕时停止事件传播.
It took me a little time but I have a solution for this. What I did is stop the event propagation if more than one finger is touching the screen.
mapView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if(event.getPointerCount() > 1) {
return true;
}
return false;
}
});
这篇关于如何在 Android MapView 中禁用捏合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文