Sdílet prostřednictvím


ImageView.ImageTintList Property

Definition

Get the current android.content.res.ColorStateList used to tint the image Drawable, or null if no tint is applied. -or- Applies a tint to the image drawable.

public virtual Android.Content.Res.ColorStateList? ImageTintList { [Android.Runtime.Register("getImageTintList", "()Landroid/content/res/ColorStateList;", "GetGetImageTintListHandler")] get; [Android.Runtime.Register("setImageTintList", "(Landroid/content/res/ColorStateList;)V", "GetSetImageTintList_Landroid_content_res_ColorStateList_Handler")] set; }
[<get: Android.Runtime.Register("getImageTintList", "()Landroid/content/res/ColorStateList;", "GetGetImageTintListHandler")>]
[<set: Android.Runtime.Register("setImageTintList", "(Landroid/content/res/ColorStateList;)V", "GetSetImageTintList_Landroid_content_res_ColorStateList_Handler")>]
member this.ImageTintList : Android.Content.Res.ColorStateList with get, set

Property Value

the tint applied to the image drawable

Attributes

Remarks

Property getter documentation:

Get the current android.content.res.ColorStateList used to tint the image Drawable, or null if no tint is applied.

Java documentation for android.widget.ImageView.getImageTintList().

Property setter documentation:

Applies a tint to the image drawable. Does not modify the current tint mode, which is PorterDuff.Mode#SRC_IN by default.

Subsequent calls to #setImageDrawable(Drawable) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

<em>Note:</em> The default tint mode used by this setter is NOT consistent with the default tint mode used by the android.R.styleable#ImageView_tint android:tint attribute. If the android:tint attribute is specified, the default tint mode will be set to PorterDuff.Mode#SRC_ATOP to ensure consistency with earlier versions of the platform.

Java documentation for android.widget.ImageView.setImageTintList(android.content.res.ColorStateList).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also