进入目标区域 return true; case DragEvent.ACTION_DRAG_LOCATION: // 被拖拽View在目标区域移动 return true; case DragEvent.ACTION_DRAG_EXITED: // 被拖拽View离开目标区域 return true; case DragEvent.ACTION_DROP: // 放开被拖拽View int position = 0; // 获取TextView的Layout对象 Layout layout = tvContent.getLayout(); // 当前x、y坐标 float currentX = event.getX(); float currentY = event.getY(); // 如果拖拽答案没有进行填空则return boolean isContinue = false; for (int i = 0; i xAxisLeft) { // 填空在一行 if (currentX > xAxisLeft && currentX yAxisTop) { position = i; isContinue = true; break; } } else { // 跨行填空 if ((currentX > xAxisLeft || currentX yAxisTop) { position = i; isContinue = true; break; } } } if (!isContinue) { return true; } // 释放拖放阴影,并获取移动数据 ClipData.Item item = event.getClipData().getItemAt(0); String answer = item.getText().toString(); // 重复拖拽,在答案列表中显示原答案 String oldAnswer = answerList.get(position); if (!TextUtils.isEmpty(oldAnswer)) { llOption.getChildAt(getOptionPosition(oldAnswer)).setVisibility(VISIBLE); } // 填写答案 fillAnswer(answer,