#鸿蒙通关秘籍# 如何在HarmonyOS 5.0中使用PhotoViewPicker从图库选择图片并在应用中显示?

HarmonyOS
2024-12-10 11:32:57
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
一路向北545
let uris: Array<string> = [];
const photoViewPicker = new photoAccessHelper.PhotoViewPicker();
photoViewPicker.select(photoSelectOptions).then((photoSelectResult: photoAccessHelper.PhotoSelectResult) => {
  uris = photoSelectResult.photoUris;
  console.info('photoViewPicker.select to file succeed and uris are:' + uris);
}).catch((err: BusinessError) => {
  console.error(`Invoke photoViewPicker.select failed, code is ${err.code}, message is ${err.message}`);
})


​https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/photoaccesshelper-photoviewpicker-V5​

分享
微博
QQ
微信
回复
2024-12-14 21:01:16
相关问题