Android Guides | Samples

Android.Graphics.Drawables.Drawable.SetColorFilter Method

Specify a color and Porter-Duff mode to be the color filter for this drawable.

Syntax

[Android.Runtime.Register("setColorFilter", "(ILandroid/graphics/PorterDuff$Mode;)V", "GetSetColorFilter_ILandroid_graphics_PorterDuff_Mode_Handler")]
public virtual Void SetColorFilter (Color color, PorterDuff+Mode mode)

Parameters

color
mode

Remarks

Specify a color and Porter-Duff mode to be the color filter for this drawable.

Convenience for Drawable.SetColorFilter(ColorFilter) which constructs a PorterDuffColorFilter.

Note: Setting a color filter disables Drawable.SetTintList(ColorStateList).

[Android Documentation]

Requirements

Namespace: Android.Graphics.Drawables
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1