【发布时间】:2019-03-04 15:43:06
【问题描述】:
我尝试使用以下代码将颜色更改为 MaterialButton:
var materialButton = findViewByid(R.id....) as MaterialButton
materialButton.setBackgroundColor( ContextCompat.getColor(this@MyActivity, R.color.myCustomColor));
使用普通按钮,它可以工作。 有人有什么想法吗?
【问题讨论】:
-
它至少适用于
com.google.android.material:material:1.2.0-alpha03。
标签: android kotlin material-design