如何禁用捏在Android的图形页面 [英] How to disable pinch in Android MapView
本文介绍了如何禁用捏在Android的图形页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您如何禁用或捏多点触摸功能在Android图形页面?
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的图形页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文