我有一个GridView with CheckBoxes
,每次用户点击CheckBox时我都会调用TextView.setText()
,不知怎的,调用setText()
会禁用Android给Checkset的默认动画。为什么会这样?
修改 这是我的听众:
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
checkedPositions.add(position + 1);
} else {
checkedPositions.remove(new Integer(position + 1));
}
//removing this line brings back the animation
TextView.setText("some text");
}
});