将最上层容器组件背景色设置为透明,然后通过设置XComponent组件的opacity属性值为0.01来实现。示例代码build() { Stack() { XComponent({ id: 'componentId', type: 'surface', }) .width('100%') .height('100%') .opacity(0.01) // 页面内容 } .width('100%') .height('100%') .backgroundColor('rgba(255,255,255, 0)') }
将最上层容器组件背景色设置为透明,然后通过设置XComponent组件的opacity属性值为0.01来实现。
示例代码