晴川云鸿蒙OS教程:鸿蒙OS Component.BindStateChangedListener

Component.BindStateChangedListener

public static interface Component.BindStateChangedListener

提供当组件绑定到其窗口或从其窗口分离时要调用的回调。

方法总结

修饰符和类型 方法 描述
void onComponentBoundToWindow(Component component) 当组件绑定到窗口时调用。
void onComponentUnboundFromWindow(Component component) 当组件与窗口解除绑定时调用。

方法详情

onComponentBoundToWindow

void onComponentBoundToWindow(Component component)

当组件绑定到窗口时调用。

参数:

参数名称 参数描述
component 表示已绑定到窗口的组件。

onComponentUnboundFromWindow

void onComponentUnboundFromWindow(Component component)

当组件与窗口解除绑定时调用。

参数:

参数名称 参数描述
component 指示已从窗口分离的组件。

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/3061.html

(0)
晴川运维晴川运维
上一篇 2025年6月1日
下一篇 2025年6月1日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注