GridView怎么实现长按改变颜色(单选),只是当前选中那块改变颜色,其他不变.再长按其他的,就换到其他的改变颜色.原来被长按那个恢复.是长按
for (int i=0;i < arg0.getChildCount();i++){
if (position==i){
v.setBackgroundColor();
}else{
v.setBackgroundColor();
}
}
gridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
view.setBackgroundColor(...);
return true;
}
});