Compartir a través de


Drawable.SetTint(Int32) Method

Definition

Specifies tint color for this drawable.

[Android.Runtime.Register("setTint", "(I)V", "GetSetTint_IHandler")]
public virtual void SetTint (int tintColor);
[<Android.Runtime.Register("setTint", "(I)V", "GetSetTint_IHandler")>]
abstract member SetTint : int -> unit
override this.SetTint : int -> unit

Parameters

tintColor
Int32

Color to use for tinting this drawable

Attributes

Remarks

Specifies tint color for this drawable.

A Drawable's drawing content will be blended together with its tint before it is drawn to the screen. This functions similarly to #setColorFilter(int, PorterDuff.Mode).

To clear the tint, pass null to #setTintList(ColorStateList).

<p class="note"><strong>Note:</strong> Setting a color filter via #setColorFilter(ColorFilter) or #setColorFilter(int, PorterDuff.Mode) overrides tint. </p>

Java documentation for android.graphics.drawable.Drawable.setTint(int).

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