<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:elevation="5dp"
app:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/img_delete"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="7dp"
android:src="@drawable/ic_remove"
app:tint="@color/design_default_color_error"
android:tint="@color/white"
/> <!-- Setting tints of Image -->
</LinearLayout>
</androidx.cardview.widget.CardView>这段代码显示了在ImageView中添加色调,我想问一下什么是色调,它的效果是什么,以及我使用的两种色调之间的区别是什么。
发布于 2020-12-31 13:44:22
在这两种情况下,这都会设置图像的着色颜色,但是由于see here的兼容性原因,android:tint有一些问题。此外,它不适用于低于api级别21的版本。所以使用app:tint将是最好的方式。
https://stackoverflow.com/questions/65516942
复制相似问题