定义shape时,代码能动态替换shape的颜色属性

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lf12345678910/article/details/77719075

How to change `solid color` from the code?

https://stackoverflow.com/questions/16775891/how-to-change-solid-color-from-the-code

【Android】使用shape的同时,动态替换shape的颜色属性

http://blog.csdn.net/u010983881/article/details/52154283

一个shape布局,对应多个颜色的view

		ImageView iconView = (ImageView) view.findViewById(R.id.icon);
		GradientDrawable myGrad = (GradientDrawable)iconView.getBackground();
		myGrad.setColor(mColor);

猜你喜欢

转载自blog.csdn.net/lf12345678910/article/details/77719075