HarmonyOS savebutton的使用影响图片保存?

savebutton位置影响保存功能,SaveButton和Text的位置互换,会影响保存的功能。

Row() {

 SaveButton({ text: SaveDescription.SAVE, buttonType: ButtonType.Normal })

   .fontColor(Color.White)

   .backgroundColor(Color.Black)

   .width(100)

   .onClick(async () => {

     if (this.imgBuffersMap.get(this.selectedIndex - 1)) {

       this.saveImage(this.imgBuffersMap.get(this.selectedIndex - 1)).then(() => {

         promptAction.showToast({

           message: $r("app.string.saveImgSuccess"),

           duration: 2000

         })

       }).catch(() => {

         promptAction.showToast({

           message: $r("app.string.saveImgFail"),

           duration: 2000

         })

       })

     }

   })

 Text(this.selectedIndex + "/" + this.imgUrls.length)

   .fontColor(Color.White)

   .fontSize(FontSizeUtil.getFontSize(15))

   .padding({ right: adapt(20) })

}

.width("100%")

.justifyContent(FlexAlign.SpaceBetween)

.padding({ bottom: adapt(30) })

harmonyos
harmonyos-next
2024-11-20 14:45:58
浏览
收藏 0
回答 0
待解决
相关问题
HarmonyOS savebutton使用影响图片保存
247浏览 • 1回复 待解决
使用SaveButton保存图片方式
861浏览 • 1回复 待解决
HarmonyOS SaveButton保存图片授权失败
212浏览 • 1回复 待解决
使用图片压缩API参数影响
774浏览 • 1回复 待解决
HarmonyOS SaveButton只显示图片
535浏览 • 1回复 待解决
HarmonyOS 使用picker保存网络图片
83浏览 • 1回复 待解决
HarmonyOS 图片保存
286浏览 • 1回复 待解决
HarmonyOS 图片保存失败
90浏览 • 1回复 待解决
HarmonyOS 图片保存功能
229浏览 • 1回复 待解决
HarmonyOS图片保存相册问题
768浏览 • 1回复 待解决
HarmonyOS 保存图片文件异常
593浏览 • 1回复 待解决
HarmonyOS saveButton控件问题
265浏览 • 1回复 待解决
HarmonyOS 图片保存到相册
65浏览 • 1回复 待解决