Reputation: 4487
imageView.setColorFilter(Color.argb(255, 255, 255, 255));
I would like to change the alpha value to 10 percent (25) like this.
imageView.setColorFilter(Color.argb(25, 255, 255, 255));
But the color become black rather than transparent white. Any thoughts?
Upvotes: 0
Views: 839
Reputation: 1959
agree with @RRR you can use this too
define trans_black in color.xml with code #1A000000
ImageView logoImage = (ImageView) findViewById(R.id.logo);
logoImage.setColorFilter(getApplicationContext().getResources().getColor(R.color.trans_black));
Upvotes: 1
Reputation: 103
Set a mode.
setColorFilter(Color.argb(25, 255, 255, 255),PorterDuff.Mode.MULTIPLY);
Upvotes: 1