gpt4 book ai didi

Android - 将一个 Drawable 设置为多个按钮

转载 作者:行者123 更新时间:2023-11-30 00:09:15 32 4
gpt4 key购买 nike

将相同的Drawable设置为多个按钮/ View 作为背景(使用setBackground(Drawable)有涟漪效应的问题,当我点击按钮A时,涟漪效应将显示按钮 B。

注意:我测试了 mutate() 但没有任何效果

最佳答案

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

关于Android - 将一个 Drawable 设置为多个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48424858/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com