OnTouch in MapView only fires the first time

后端 未结 6 884
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 02:04

I\'m trying to implement a double-tap zoom like function in my MapView. The event always fires the first time, but never subsequent times. Below is my code. I have a feeling

6条回答
  •  离开以前
    2020-12-17 02:43

    Implement the Touch event on the map view instead. That will work!!

        // The onTouch event of the Map itself does not fire!
        // We must implement it on the mapView!!!
        mapView.setOnTouchListener(new OnTouchListener()
        {
            public boolean onTouch(View v, MotionEvent event) 
            {
                // Your code and remember to return true!                
    
                return (true);
            }
        });
    

提交回复
热议问题