如何在andoidx中的AppCompatImageButton中设置图像颜色?因为我尝试在 AppCompatImageButton 的 xml 中设置颜色背景色调,但它没有设置。有什么解决办法吗?
最佳答案
您应该着色来改变图像的颜色,
<androidx.appcompat.widget.AppCompatImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@color/colorPrimary"
app:srcCompat="@drawable/ic_home_black_24dp"/>
关于android - 在Android中的AppCompatImageButton或imageview中设置图像颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60651883/