PopupOptions提供了radius,使用这个,参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-universal-attributes-popup-V5\#popupoptions类型说明demo:@Entry @Component struct Index { @State customPopup: boolean = false // popup构造器定义弹框内容 @Builder popupBuilder() { Row({ space: 2 }) { Image($r("app.media.startIcon")).width(24).height(24).margin({ left: 5 }) Text('This is Custom Popup').fontSize(15) } .width(200) .height(50) .padding(5) } build() { Column() { Button('CustomPopupOptions') .position({ x: 100, y: 200 }) .onClick(() => { this.customPopup = !this.customPopup }) .bindPopup(this.customPopup, { builder: this.popupBuilder, // 气泡的内容 placement: Placement.Bottom, // 气泡的弹出位置 popupColor: Color.Pink, // 气泡的背景色 onStateChange: (e) => { console.info(JSON.stringify(e.isVisible)) if (!e.isVisible) { this.customPopup = false } }, radius:5 }) } .height('100%') } }
PopupOptions提供了radius,使用这个,参考文档:
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-universal-attributes-popup-V5\#popupoptions类型说明
demo: