I can set tint through XML but I am not able to set it programmatically so please tell me how can I set tint Color programmatically.
- 6 years ago
try this:
imageView.setColorFilter(ContextCompat.getColor(context, R.color.COLOR_YOUR_COLOR), android.graphics.PorterDuff.Mode.MULTIPLY);
- 5 years ago
Programmatically Try :
imageView.setColorFilter(Color.argb(245, 57, 57,5));
and
Try this in your XML file :
<ImageView
android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_user"
android:tint="#ff0000"
/>
Goal Ploy - Money Management App