Android Guides | Samples

Android.Graphics.Drawables.Drawable.SetLevel Method

Specify the level for the drawable.

Syntax

[Android.Runtime.Register("setLevel", "(I)Z", "")]
public Boolean SetLevel (Int32 level)

Parameters

level
The new level, from 0 (minimum) to 10000 (maximum).

Remarks

Specify the level for the drawable. This allows a drawable to vary its imagery based on a continuous controller, for example to show progress or volume level.

If the new level you are supplying causes the appearance of the Drawable to change, then it is responsible for calling Drawable.InvalidateSelf in order to have itself redrawn, and true will be returned from this function.

[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