Android change color of ImageView / Bitmap

后端 未结 5 1291
-上瘾入骨i
-上瘾入骨i 2021-02-15 11:19

I need to find a way to change the color of bitmap in Android. I need to replace/change colors of oval image smoothly in my application depending on int value. I ne

5条回答
  •  孤独总比滥情好
    2021-02-15 12:04

    Should you this.

    Drawable myIcon = getResources().getDrawable( R.drawable.button ); 
    ColorFilter filter = new LightingColorFilter( Color.BLACK, Color.BLACK);
    myIcon.setColorFilter(filter);
    

提交回复
热议问题