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

HarmonyOS
2024-12-18 16:23:43
浏览
收藏 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%")
  }
}
分享
微博
QQ
微信
回复
2024-12-18 17:47:57
相关问题
HarmonyOS 弹窗自带背景色
679浏览 • 1回复 待解决
HarmonyOS 关于开屏背景色
798浏览 • 1回复 待解决
HarmonyOS 如何设置渐变背景色
3089浏览 • 1回复 待解决
如何设置窗口的背景色
3043浏览 • 1回复 待解决
如何设置WebView的背景色
2074浏览 • 2回复 待解决
JSUI按钮 toolbar的按下背景色怎么去掉
6086浏览 • 1回复 待解决
Button组件如何设置渐变背景色
4142浏览 • 1回复 待解决
HarmonyOS Select组件的背景色如何设置
876浏览 • 1回复 待解决
TextInput按压态背景色如何修改
3642浏览 • 1回复 待解决
AlertDialog没有找到设置背景色API
1455浏览 • 1回复 待解决
使用js引擎 设置dom背景色无效
1549浏览 • 0回复 待解决
HarmonyOS 如何修改顶部导航栏的背景色
1000浏览 • 1回复 待解决
HarmonyOS 自定义Dialog背景色透明问题
2236浏览 • 1回复 待解决
HarmonyOS List组如何将背景色设置透明
723浏览 • 1回复 待解决