避免 Xamarin 相机的 OK 重试按钮 [英] Avoid OK Retry button for Xamarin Camera

查看:16
本文介绍了避免 Xamarin 相机的 OK 重试按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是来自https://github.com/rasmuschristensen/XamarinFormsImageGallery打开相机,拍照并在画廊中显示.在机器人项目中,拍照后,对话框要求保留照片或使用确定"和重试"按钮丢弃照片.反正有没有,我可以避开这一步,进入下一步.

I am using the Camera code base from https://github.com/rasmuschristensen/XamarinFormsImageGallery to open camera, take picture and show in the gallery. In the droid project, after taking the picture, the dialog asks either to keep the photo or discard it using OK and Retry button. Is there anyway, I can avoid this step and go to next step.

问候

推荐答案

使用媒体插件您将无法做到.此插件使用 Android 中的标准方式拍摄照片,该方式依赖于设备实际的相机应用程序.保存/重试功能是相机应用程序的一部分,我们无法访问它,因为这在 Android供应商"(三星、LG、索尼等)之间会有所不同

Using the Media plugin you won't be able to do it. This plugin use the standard way of capturing photos in Android which rely on the device actual camera app. The save/retry functionality is part of the Camera App and we don't have access to it as this will be different between Android "providers" (Samsung, LG, Sony, etc)

避免这种情况的一种方法是使用 SurfaceView 而不是使用相机应用在您自己的应用中拍摄照片.我找到了 this 示例,但不幸的是它是用 Java 编写的,但我认为翻译成 Xamarin/C# 并不太难.

One way to avoid this is capturing the photo within your own app using the SurfaceView and not using the camera app. I found this example but unfortunately is written in Java but I think it's not too hard to translate into Xamarin/C#.

这篇关于避免 Xamarin 相机的 OK 重试按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆