Most visited

Recently visited

Added in API level 1

ViewManager

public interface ViewManager

android.view.ViewManager
Known Indirect Subclasses


界面允许您添加和删除子视图到活动。 要获得此类的实例,请致电Context.getSystemService()

Summary

Public methods

abstract void addView(View view, ViewGroup.LayoutParams params)

将传递的LayoutParams分配给传递的View并将视图添加到窗口。

abstract void removeView(View view)
abstract void updateViewLayout(View view, ViewGroup.LayoutParams params)

Public methods

addView

Added in API level 1
void addView (View view, 
                ViewGroup.LayoutParams params)

将传递的LayoutParams分配给传递的View并将视图添加到窗口。

针对某些编程错误引发 WindowManager.BadTokenException ,如在不删除第一个视图的情况下向窗口添加第二个视图。

抛出 WindowManager.InvalidDisplayException如果窗口上的二次 Display和指定显示无法找到(见 Presentation )。

Parameters
view View: The view to be added to this window.
params ViewGroup.LayoutParams: The LayoutParams to assign to view.

removeView

Added in API level 1
void removeView (View view)

Parameters
view View

updateViewLayout

Added in API level 1
void updateViewLayout (View view, 
                ViewGroup.LayoutParams params)

Parameters
view View
params ViewGroup.LayoutParams

Hooray!