android - MaterialButton 内的进度条
解决方案
我设法简单地使用:
val progress = CircularProgressDrawable(context).apply {
setStyle(CircularProgressDrawable.DEFAULT)
// do use setBounds if you need to
start()
}
myMaterialButton.setCompoundDrawablesWithIntrinsicBounds(null, progress, null, null)
// Do your stuff
//replace the image by the one you want
myMaterialButton.setCompoundDrawablesWithIntrinsicBounds(null, myDrawable, null, null)
推荐阅读
- jenkins - 如何在 consul 中添加服务 - 使用 groovy jenkins 管道
- java - 如何将日历转换为带时区的 XML 日期格式?
- python - 在无头状态下发生 Python Selenium 错误?
- c - 尝试重新排序链表时 free() 无效
- javascript - getElementById(...) 为 null - 具有 2 个变量的函数
- kotlin - 如何在 Kotlin 中将可变数量的函数作为参数传递?
- sql - 如何内部连接多个 sum/group 查询,每个查询都有不同的 where 子句?
- javascript - ThreeJs:加载程序未正确加载
- data-structures - 保存一组范围合并相交范围的结构
- sql-server - 列“Book.Name”在选择列表中无效,因为它不包含在任一聚合函数中