HarmonyOS 气泡提示 (Popup)怎么去除背景色

HarmonyOS
2024-12-18 16:23:43
589浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Excelsior_abit

主要配置 shadow:{radius:0}

@Entry
@Component
struct Index {
  @State customPopup: boolean = false
  // popup构造器定义弹框内容
  @Builder
  popupBuilder() {
    Row({ space: 2 }) {
      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.Transparent, // 气泡的背景色
          backgroundBlurStyle: BlurStyle.NONE,
          shadow: { radius: 0 },
          // shadow:ShadowStyle.OUTER_DEFAULT_XS,
          onStateChange: (e) => {
            console.info(JSON.stringify(e.isVisible))
            if (!e.isVisible) {
              this.customPopup = false
            }
          }
        })
    }
    .backgroundColor(Color.Pink)
    .height('100%')
    .width("100%")
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
分享
微博
QQ
微信
回复
2024-12-18 17:47:57


相关问题
HarmonyOS 弹窗自带背景色
378浏览 • 1回复 待解决
HarmonyOS 关于开屏背景色
479浏览 • 1回复 待解决
HarmonyOS 如何设置渐变背景色
1970浏览 • 1回复 待解决
如何设置WebView的背景色
1450浏览 • 1回复 待解决
如何设置窗口的背景色
2371浏览 • 1回复 待解决
JSUI按钮 toolbar的按下背景色怎么去掉
5717浏览 • 1回复 待解决
TextInput按压态背景色如何修改
3035浏览 • 1回复 待解决
Button组件如何设置渐变背景色
3488浏览 • 1回复 待解决
HarmonyOS Select组件的背景色如何设置
484浏览 • 1回复 待解决
使用js引擎 设置dom背景色无效
1231浏览 • 0回复 待解决
AlertDialog没有找到设置背景色API
1072浏览 • 1回复 待解决
HarmonyOS 自定义Dialog背景色透明问题
1698浏览 • 1回复 待解决
HarmonyOS 弹框背景色如何自定义图片
497浏览 • 1回复 待解决