public class ViewOverlay
extends Object
| java.lang.Object | |
| android.view.ViewOverlay | |
| |
覆盖图是位于视图顶部的额外图层(“主机视图”),该视图在该视图中的所有其他内容(包括子视图,如果视图是ViewGroup)之后绘制。 与覆盖层的交互是通过添加和删除drawable来完成的。
从ViewGroup请求的叠加层类型为 ViewGroupOverlay ,该叠加层还支持添加和删除视图。
公共方法(Public methods) |
|
|---|---|
void |
add(Drawable drawable) 将 |
void |
clear() 删除叠加层中的所有内容。 |
void |
remove(Drawable drawable) 从叠加层中删除指定的 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
void add (Drawable drawable)
将Drawable添加到叠加层。 drawable的边界应该相对于主机视图。 添加到叠加层的任何可绘制图标在不再需要或不再可见时应该删除。 添加一个已经存在的Drawable是没有任何操作的。 传递null参数将导致IllegalArgumentException被抛出。
| 参数(Parameters) | |
|---|---|
drawable |
Drawable: The Drawable to be added to the overlay. This drawable will be drawn when the view redraws its overlay. Drawables will be drawn in the order that they were added. |
也可以看看:
void remove (Drawable drawable)
从叠加层中删除指定的Drawable 。 卸下Drawable ,这不是添加了add(Drawable)是一个空操作。 传递参数null将导致IllegalArgumentException被抛出。
| 参数(Parameters) | |
|---|---|
drawable |
Drawable: The Drawable to be removed from the overlay. |
也可以看看: