请考虑以下方案(为了更好地理解我的问题).

如您所见,我正在考虑用填充包围的列表视图.现在,如果用户按下列表视图项,则为我提供的操作为浅蓝色背景颜色.现在,我的应用程序正在处理onTouch事件本身以确定类似的操作
这是我的代码.
public boolean onTouch(View v, MotionEvent event) {
if(v == null)
{
mSwipeDetected = Action.None;
return false;
}
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN: {
downX = event.getRawX();
downY = event.getRawY();
mSwipeDetected = Action.Start;
// Find the child view that was touched (perform a hit test)
Rect rect = new Rect();
int childCount = listView.getChildCount();
int[] listViewCoords = new int[2];
listView.getLocationOnScreen(listViewCoords);
int x = (int) event.getRawX() - listViewCoords[0];
int y = (int) event.getRawY() - listViewCoords[1];
View …Run Code Online (Sandbox Code Playgroud) 我正在尝试禁用缩放并在地图框中平移mapview.我使用mapbox 0.4.0.目前我可以禁用缩放,但无法禁用平移
MapView mv = (MapView) tab.findViewById(R.id.mapid);
mv.setZoom(14);
mv.setMaxZoomLevel(14);
mv.setMinZoomLevel(14);
Run Code Online (Sandbox Code Playgroud)