TextView.setText禁用CheckBox的默认动画

时间:2015-08-16 16:40:21

标签: android textview android-checkbox

我有一个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");
            }
        });

0 个答案:

没有答案