是否有可能为api <21进行可绘制的着色工作?
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_calendar"
android:tint="@color/primary" />
Run Code Online (Sandbox Code Playgroud)
工作正常但仅适用于具有API21的设备.针对较低api设备或AppCompat支持的任何解决方法?找不到任何东西.
<?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>
Run Code Online (Sandbox Code Playgroud)
此代码显示在 ImageView 中添加色调,我想问什么是色调,它的效果在哪里,以及我使用的两种类型的色调之间有什么区别。
android ×2