我有在图像之间有一些透明区域的png图像。我试图设置颜色以编程方式到那个区域,但它不工作。如何在Android中设置图像的背景颜色
这是我的XML布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/iv_cat_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/del"
card_view:civ_border_color="@color/tabsScrollColor" />
</RelativeLayout>
在XML中使用该card_view在XML我能够设置颜色我已经自定义属性
xmlns:card_view="http://schemas.android.com/apk/res-auto
,但我需要以编程方式更改其color.is无论如何,我可以设置此属性编程?请任何人帮助我。
的'检查对象CircularImageView'它具有功能来设置颜色。 –
我尝试,但它不工作。 – sunil