droid_wrap::android::view

Trait ViewManager

Source
pub trait ViewManager:
    JType
    + JObjRef
    + JObjNew
    + PartialEq
    + Debug {
    const CLASS: &'static str = "android/view/ViewManager";
    const OBJECT_SIG: &'static str = "Landroid/view/ViewManager;";
    const DIM: u8 = 0u8;

    // Required method
    fn add_view(
        &self,
        view: &View,
        params: &ViewGroup_LayoutParams,
    ) -> Result<(), <Self as JType>::Error>;
}
Expand description

接口允许您向 Activity 添加和删除子视图。要获取此类的实例,请调用 Context.getSystemService()。

Provided Associated Constants§

Source

const CLASS: &'static str = "android/view/ViewManager"

android/view/ViewManager

Source

const OBJECT_SIG: &'static str = "Landroid/view/ViewManager;"

Landroid/view/ViewManager;

Source

const DIM: u8 = 0u8

数组维度

Required Methods§

Source

fn add_view( &self, view: &View, params: &ViewGroup_LayoutParams, ) -> Result<(), <Self as JType>::Error>

将传递的 LayoutParams 分配给传递的 View,并将该视图添加到窗口。对于某些编程错误,例如在未移除第一个视图的情况下向窗口添加第二个视图,将抛出 WindowManager.BadTokenException。 如果窗口位于辅助显示器上并且找不到指定的显示器,则抛出 WindowManager.InvalidDisplayException(请参阅 android.app.Presentation)。 view 要添加到此窗口的视图。 params 要分配给视图的 LayoutParams。

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§