安卓代码修改shape颜色

2020-12-30  本文已影响0人  盘龙守护

<?xml version="1.0" encoding="utf-8"?>

android:topLeftRadius="8dp"

android:topRightRadius="8dp"

android:bottomLeftRadius="8dp"

android:bottomRightRadius="8dp"/>

android:color="#00000000"/>

用下面的方式修改shape的color的颜色值

GradientDrawable myGrad = (GradientDrawable)view.getBackground();

myGrad.setColor(color);

上一篇 下一篇

猜你喜欢

热点阅读