MyTouchListener tl = new MyTouchListener(this, mMapView); mMapView.setOnTouchListener(tl);
class MyTouchListener extends MapOnTouchListener{ ScrollView sv; public MyTouchListener(Context c, MapView m){ super(c, m); } // gets the touch event for the MapView public boolean onTouch(View v, MotionEvent event){ sv = (ScrollView) findViewById(R.id.scrollview); int action = event.getAction(); switch(action){ case MotionEvent.ACTION_DOWN: // Disallow your scrollview id to intercept the touch event sv.requestDisallowInterceptTouchEvent(true); break; case MotionEvent.ACTION_UP: // Gives touch control back to the ScrollView sv.requestDisallowInterceptTouchEvent(false); break; } super.onTouch(v, event); return true; } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.