Trait droid_wrap::android::view::ViewManager
source · pub trait ViewManager: JObjRef + JObjNew + PartialEq + Debug {
const CLASS: &'static str = "android/view/ViewManager";
const OBJECT_SIG: &'static str = "Landroid/view/ViewManager;";
// Required method
fn add_view(&self, view: &View, params: &ViewGroup_LayoutParams);
}Expand description
- 接口允许您向 Activity 添加和删除子视图。要获取此类的实例,请调用 Context.getSystemService()。
Provided Associated Constants§
sourceconst OBJECT_SIG: &'static str = "Landroid/view/ViewManager;"
const OBJECT_SIG: &'static str = "Landroid/view/ViewManager;"
Landroid/view/ViewManager;
Required Methods§
sourcefn add_view(&self, view: &View, params: &ViewGroup_LayoutParams)
fn add_view(&self, view: &View, params: &ViewGroup_LayoutParams)
- 将传递的 LayoutParams 分配给传递的 View,并将该视图添加到窗口。对于某些编程错误,例如在未移除第一个视图的情况下向窗口添加第二个视图,将抛出 WindowManager.BadTokenException。
- 如果窗口位于辅助显示器上并且找不到指定的显示器,则抛出 WindowManager.InvalidDisplayException(请参阅 android.app.Presentation)。
view要添加到此窗口的视图。params要分配给视图的 LayoutParams。
Object Safety§
This trait is not object safe.