简体   繁体   English

在反应本机博览会应用程序上由博览会图像选择器打开的相机顶部添加一个视图

[英]add a viw on top of camera opened by expo Image picker on react native expo application

I am currently using react native image picker library to open camera , and I would like to add a message in the form of a snack bar or a toast message on top of the opened camera using the following function:我目前正在使用 react native image picker library 打开 camera ,我想使用以下函数在打开的相机顶部添加一条小吃店或 toast 消息形式的消息:

let result = await ImagePicker.launchCameraAsync({ allowsEditing: true, mediaTypes: ImagePicker.MediaTypeOptions.All, base64: true, //return base64 data., aspect: [1, 1], quality: 0.5 }); let result = await ImagePicker.launchCameraAsync({ allowedEditing: true, mediaTypes: ImagePicker.MediaTypeOptions.All, base64: true, //return base64 data., aspect: [1, 1], quality: 0.5 });

is it possible to do so using this library?可以使用这个库吗? to add a design or a view on top of current camera?在当前相机上添加设计或视图? or even the image taken by this camera from the library?甚至是这台相机从图书馆拍摄的图像?

I don't understand which message you want to show but, you can call a function with a button, there dispatch any kind of snackbar, alert, etc. Then launch the camera.我不明白你想显示哪条消息,但你可以用一个按钮调用一个函数,在那里发送任何类型的小吃店、警报等。然后启动相机。

If you want to pick an image from gallery you need to call ImagePicker.launchImageLibraryAsync (both accept the same option params) https://docs.expo.dev/versions/latest/sdk/imagepicker/#usage如果要从图库中选择图像,则需要调用 ImagePicker.launchImageLibraryAsync (两者都接受相同的选项参数) https://docs.expo.dev/versions/latest/sdk/imagepicker/#usage

You can use two buttons to call each one, or one button with a selection camera/gallery pop up for the user.您可以使用两个按钮来调用每个按钮,或者使用一个按钮为用户弹出选择相机/图库。

Hope it希望它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM