鸿蒙next开发:混合模式开发-ContentSlot

用于渲染并管理Native层使用C-API创建的组件。

支持混合模式开发,当容器是ArkTS组件,子组件在Native侧创建时,推荐使用ContentSlot占位组件。

接口

ContentSlot组件接口

ContentSlot(content: Content); // 当前开发者需要使用ArkUI提供的NodeContent作为管理器
参数名 类型 必填 参数描述
content Content Content作为ContentSlot的管理器,通过Native侧提供的接口,可以注册并触发ContentSlot的上下树事件回调以及管理ContentSlot的子组件。
abstract class Content {
}

ContentSlotInterface

(content: Content): ContentSlotAttribute;

当内容添加到占位符组件时调用

系统能力: SystemCapability.ArkUI.ArkUI.Full

参数:

参数名 类型 必填 参数描述
content Content Content作为ContentSlot的管理器,通过Native侧提供的接口,可以注册并触发ContentSlot的上下树事件回调以及管理ContentSlot的子组件。

ContentSlotAttribute

定义ContentSlot属性,以防止不正确的递归使用ContentSlot

系统能力: SystemCapability.ArkUI.ArkUI.Full

Native侧接口

接口名 描述
OH_ArkUI_NodeContent_RegisterCallback(ArkUI_NodeContentHandle content, ArkUI_NodeContentCallback callback) 向管理器Content上注册事件。
OH_ArkUI_NodeContentEven
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值