使用半模态转场bindSheet,指定SheetMode为EMBEDDED时,弹层无法弹出,想请教具体用法,下方是相关代码,如果将SheetMode改为OVERLAY就可以弹出
build() {
RelativeContainer() {
Column() {}
.width('100%')
.height('100%')
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End }
});
}
.bindSheet(true, this.buildBottomSheet(), {
showClose: false,
dragBar: false,
preferType: SheetType.BOTTOM,
// enableOutsideInteractive:true,
mode:SheetMode.EMBEDDED,
detents: [122, 32, 32],
})
.padding({ bottom: this.bottomRectHeight })
.width('100%')
.height('100%')
}
@Builder
buildBottomSheet() {
Column()
.width('100%')
.height('100%')
.backgroundColor(Color.Green)
}
可以参考这个demo: