【问题标题】:Change textview and checkbox button color while listview is enabled android启用列表视图时更改文本视图和复选框按钮颜色
【发布时间】:2013-10-17 17:19:53
【问题描述】:

我想在启用列表视图时更改复选框按钮的颜色,在禁用列表视图时更改其他颜色

【问题讨论】:

  • 澄清一下,您的意思是当ListView item 被启用/禁用时,对吗?
  • 我在顶部有一个复选框。如果选中该复选框,则列表视图已启用。那时我需要在列表视图中为 textview 指定颜色

标签: android listview


【解决方案1】:

检查这个答案。可能对你有帮助

Gmail-like ListView with checkboxes (and using the ActionBar)

或者只是检查这个 listView+checkbox

【讨论】:

    【解决方案2】:
    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);
            }
    
        }
    });
    

    【讨论】:

      猜你喜欢
      • 2020-07-26
      • 1970-01-01
      • 2014-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多