代码之家  ›  专栏  ›  技术社区  ›  Alex

Android-设置可绘制的多个按钮

  •  1
  • Alex  · 技术社区  · 7 年前

    设置相同的 Drawable 将多个按钮/视图作为背景(使用 setBackground(Drawable) 有纹波问题,当我点击按钮A时,按钮B的纹波会显示出来。

    注: 我测试过 mutate() 但什么都没用

    1 回复  |  直到 7 年前
        1
  •  1
  •   Nikolay Kucheriaviy    7 年前

    尝试 Drawable newDrawable = oldDrawable.getConstantState().newDrawable().mutate();

    推荐文章