如何解决expo-image-picker android没有选择按钮
我使用的是react native和expo,expo-image-picker在iO上运行良好,并且在android上运行良好,但有一个例外。用户从图库中拉出图片时,没有“确定”,“选择”或“完成”按钮。
用户必须单击裁剪按钮以接受图像。这是典型的吗?我觉得这会造成混乱,并且会带来糟糕的用户体验...
const chooseImage = async (useCamera,index) => {
if (!(await checkPermission(useCamera))) {
Alert.alert(
"Permission missing.","Camera permission is required to take image."
);
return;
}
const method = useCamera ? "launchCameraAsync" : "launchImageLibraryAsync";
const result = await ImagePicker[method]({
allowsEditing: true,base64: false,aspect: [3,4],});
if (!result.cancelled) {
// upload image and retrieve image url
const {height,width,type,uri} = result;
profile.images[index] = uri;
if (uri != null) {
setProfile(profile);
}
setChangedValue("images");
}
};
更新
发现如果删除编辑功能allowsEditing
,则可以选择照片。但是我希望用户能够进行编辑,所以我很好奇为什么编辑上没有“确定”按钮?
解决方法
我发现裁剪按钮是“完成”按钮。
没有其他方法可以实现图像选择,因此这只是图像选择器的设计方面。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。