public class ViewOverlay extends Object
An overlay requested from a ViewGroup is of type ViewGroupOverlay
,
which also supports adding and removing views.
View.getOverlay()
,
ViewGroup.getOverlay()
,
ViewGroupOverlay
Modifier and Type | Method and Description |
---|---|
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. |
public void add(Drawable drawable)
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. Adding an already existing Drawable
is a no-op. Passing null
parameter will result in an
IllegalArgumentException
being thrown.drawable
- The Drawable
to be added to the overlay. This drawable will be
drawn when the view redraws its overlay. Drawable
s will be drawn in the order that
they were added.remove(Drawable)
public void remove(Drawable drawable)
Drawable
from the overlay. Removing a Drawable
that was
not added with add(Drawable)
is a no-op. Passing null
parameter will
result in an IllegalArgumentException
being thrown.drawable
- The Drawable
to be removed from the overlay.add(Drawable)
public void clear()