如何解决如何在本机 ios 上使用图像选择器更新我的功能
我有旧版本的图像选择器,但我不知道如何更新我的功能。你能帮我吗?
还有我的图片选择器功能
function App () {
const [filePath,setFilePath] = useState({});
const chooseFile = () => {
let options = {
title: 'Select Image',customButtons: [
{
name: 'customOptionKey',title: 'Choose Photo from Custom Option'
},],storageOptions: {
skipBackup: true,path: 'images',},};
ImagePicker.showImagePicker(options,(response) => {
console.log('Response = ',response);
if (response.didCancel) {
console.log('User cancelled image picker');
} else if (response.error) {
console.log('ImagePicker Error: ',response.error);
} else if (response.customButton) {
console.log(
'User tapped custom button: ',response.customButton
);
alert(response.customButton);
} else {
let source = response;
// You can also display the image using data:
// let source = {
// uri: 'data:image/jpeg;base64,' + response.data
// };
setFilePath(source);
}
});
};
我的错误是:TypeError: undefined is not a function (near '...ImagePicker.showImagePicker...')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。