【发布时间】:2013-10-17 17:19:53
【问题描述】:
我想在启用列表视图时更改复选框按钮的颜色,在禁用列表视图时更改其他颜色
【问题讨论】:
-
澄清一下,您的意思是当
ListViewitem 被启用/禁用时,对吗? -
我在顶部有一个复选框。如果选中该复选框,则列表视图已启用。那时我需要在列表视图中为 textview 指定颜色
我想在启用列表视图时更改复选框按钮的颜色,在禁用列表视图时更改其他颜色
【问题讨论】:
ListView item 被启用/禁用时,对吗?
检查这个答案。可能对你有帮助
Gmail-like ListView with checkboxes (and using the ActionBar)
或者只是检查这个 listView+checkbox
【讨论】:
CheckBox repeatChkBx = ( CheckBox ) findViewById( R.id.repeat_checkbox );
ListView lst = ( ListView ) findViewById( R.id.repeat_lst );
repeatChkBx.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
if ( isChecked )
{
lst.setClickable(true);
}
else
{
lst.setClickable(true);
}
}
});
【讨论】: