0
我有一個ExpandableListView,每行有四個元素。在這一行中,我在第一個項目上有一個TouchListener。現在,當我點擊(拖動)這個項目時,我想拖動整行,而不僅僅是第一個項目,並設置一個可繪製到整行的背景。如何在單擊此行中的項目時獲取整個ListView行
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
View wholerow = view.getRootView().findViewById(R.id.dbtabellelistviewitem);
wholerow.setBackgroundDrawable(view.getResources().getDrawable(R.drawable.circle));
view.setBackgroundDrawable(view.getResources().getDrawable(R.drawable.square));
ClipData data = ClipData.newPlainText("", "");
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(data, shadowBuilder, view, 0);
case MotionEvent.ACTION_UP:
view.setBackgroundDrawable(null);
}
return true;
但是,查看整行只給了我列表的第一行。如何獲取我點擊的項目的整行?
在此先感謝。
非常感謝。這就像一個魅力。 – alltooconfusingthereforesleep 2014-11-08 16:31:44