Skip to content

Most visited

Recently visited

navigation
Added in API level 18

ViewOverlay

public class ViewOverlay
extends Object

java.lang.Object
   ↳ android.view.ViewOverlay
Known Direct Subclasses


An overlay is an extra layer that sits on top of a View (the "host view") which is drawn after all other content in that view (including children, if the view is a ViewGroup). Interaction with the overlay layer is done by adding and removing drawables.

An overlay requested from a ViewGroup is of type ViewGroupOverlay, which also supports adding and removing views.

See also:

Summary

Public methods

void add(Drawable drawable)

Adds a Drawable to the overlay.

void clear()

Removes all content from the overlay.

void remove(Drawable drawable)

Removes the specified Drawable from the overlay.

Inherited methods

From class java.lang.Object

Public methods

add

Added in API level 18
void add (Drawable drawable)

Adds a Drawable to the overlay. The bounds of the drawable should be relative to the host view. Any drawable added to the overlay should be removed when it is no longer needed or no longer visible.

Parameters
drawable Drawable: The Drawable to be added to the overlay. This drawable will be drawn when the view redraws its overlay.

See also:

clear

Added in API level 18
void clear ()

Removes all content from the overlay.

remove

Added in API level 18
void remove (Drawable drawable)

Removes the specified Drawable from the overlay.

Parameters
drawable Drawable: The Drawable to be removed from the overlay.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.