android - expo-image-picker android没有选择按钮
问题描述
我正在使用 react native 和 expo,expo-image-picker 在 iOs 上运行良好,在 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
。但我希望用户能够编辑,所以我很好奇为什么编辑上没有“确定”按钮?
解决方案
我发现裁剪按钮是“完成”按钮。
没有其他方法可以实现图像的选择,所以这只是图像选择器的一个设计方面。
推荐阅读
- r - 我如何在 R 的不同行中使用乘数
- opengl - 如果包含输入图像,OpenGL 计算着色器将无法编译
- excel - 通过单击选择一个对象
- html - 对齐列元素底部 - WordPress CSS
- javascript - 如何更改 Div 的位置并将其返回到单击时的先前位置?
- r - R数据框:使用as.numeric函数时数字变为NA
- php - Flutter / Dart - 将文件发布到服务器上的目录和用户信息到 Mysql 数据库
- r - GAM(mgcv)中分类术语之间的相互作用
- docker - 使用非 root 用户附加到 Visual Studio 代码中的远程 docker 容器
- c - 内联汇编在没有优化的情况下无法编译