HarmonyOS 弹窗最外层有一圈背景色,无法去除

HarmonyOS
2024-12-25 08:57:03
5253浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
Excelsior_abit

需要添加配置:backgroundBlurStyle:BlurStyle.NONE,修改之后的代码如下:

@Entry
@Component
struct Index {
  dialogController: CustomDialogController = null!!

  build() {
    Row() {
      Text('打开dialog')
        .fontSize(30)
        .onClick(() => {
          this.dialogController = new CustomDialogController({
            builder: PaperEditionDialog({
              onSelect: (index: number) => {
              }
            }),
            cancel: () => {
          },
            backgroundBlurStyle:BlurStyle.NONE,
          autoCancel: true,
          alignment: DialogAlignment.Bottom,
          offset: { dx: 0, dy: 0 },
          showInSubWindow: false,
          isModal: true,
          customStyle: false,
          width: '88%',
          backgroundColor: Color.Transparent
        })
      this.dialogController.open()
    })
  }

}
}
@CustomDialog
export struct PaperEditionDialog {
  @Prop currentSelectIndex: number = 0
  @Prop editionArray: Array<string>
  controller?: CustomDialogController
  onSelect?: (index: number) => void
  build() {
    Column() {
      Column() {
        Grid() {
        }
        .rowsGap(20)
        .columnsGap(20)
        .columnsTemplate('1fr 1fr 1fr 1fr 1fr')
        .scrollBar(BarState.Off)
        .width('100%')
        .height(200)
      }
      .padding(20)
      .backgroundColor(Color.Green)
      .borderRadius(6)

      Image($r('app.media.small_down_icon'))
        .fillColor(Color.Green)
        .width(28)
        .margin({ left: 80, top: -2 })
    }
    .width('100%')
    .backgroundColor(Color.Transparent)

  }
}
  • 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.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
分享
微博
QQ
微信
回复
2024-12-25 10:28:05
相关问题
HarmonyOS 弹窗自带背景色
515浏览 • 1回复 待解决
HarmonyOS 关于开屏背景色
602浏览 • 1回复 待解决
HarmonyOS 如何设置渐变背景色
2319浏览 • 1回复 待解决
如何设置WebView的背景色
1646浏览 • 1回复 待解决
如何设置窗口的背景色
2618浏览 • 1回复 待解决
Button组件如何设置渐变背景色
3767浏览 • 1回复 待解决
HarmonyOS Select组件的背景色如何设置
606浏览 • 1回复 待解决
TextInput按压态背景色如何修改
3288浏览 • 1回复 待解决
使用js引擎 设置dom背景色无效
1389浏览 • 0回复 待解决
AlertDialog没有找到设置背景色API
1236浏览 • 1回复 待解决
HarmonyOS 自定义Dialog背景色透明问题
1944浏览 • 1回复 待解决
HarmonyOS List组如何将背景色设置透明
533浏览 • 1回复 待解决