【问题标题】:Whats the opposite of android.R.attr.state_checked?android.R.attr.state_checked 的反义词是什么?
【发布时间】:2012-07-29 10:07:04
【问题描述】:

我正在为按钮构建一个选择器,带有一个可绘制的状态列表,

  states.addState(new int[] {android.R.attr.state_checked},
                               checkedDrawable.getDrawable());

    states.addState(new int[] {},
                               unCheckDrawable.getDrawable());

我应该把什么放在第二个状态? 没有android.R.attr.state_unchecked

【问题讨论】:

    标签: android android-layout


    【解决方案1】:

    This question 可能会对您有所帮助。

    它说,你应该使用你需要的状态的否定。所以在你的情况下应该是:

    states.addState(new int[] {-android.R.attr.state_checked}, unCheckDrawable.getDrawable());
    

    【讨论】:

      猜你喜欢
      • 2011-01-04
      • 2014-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多