简体   繁体   English

在相机叠加层上使用标准相机按钮 (iPhone)

[英]Use Standard Camera Button on a Camera Overlay (iPhone)

I am using an Overlay on the camera views in my app.我在我的应用程序的相机视图上使用Overlay Problem is, I want to use the standard Camera Button - the long oval button that you tap to take a picture.问题是,我想使用标准的相机按钮——你点击的长椭圆形按钮来拍照。

Is there a way to add the oval camera button to my overlay?有没有办法将椭圆形相机按钮添加到我的叠加层?

Reduce the overlay view size so that it doesn't hide the camera button toolbar.减小覆盖视图大小,使其不会隐藏相机按钮工具栏。

I could not find a good way to accomplish this so I created an overlay with a large button with a camera icon on it, but it does not look like the standard camera button.我找不到完成此操作的好方法,因此我创建了一个带有一个带有相机图标的大按钮的叠加层,但它看起来不像标准的相机按钮。

Just set userInteractionEnabled to false for your overlayview.只需将您的叠加视图的 userInteractionEnabled 设置为 false。 Then all interaction with the camera will behave like it did before.然后与相机的所有交互都会像以前一样。

//edit: also make the overlayview transparent. //编辑:也使overlayview透明。 on top of that view add the view, you want to show up as overlayview, but size it as small as needed to not hide the default camera button.在该视图之上添加视图,您希望显示为叠加视图,但根据需要将其大小调整为不隐藏默认相机按钮。 if you want to change you're overlay in the photo-preview-view, see my answer here: camera overlay view - just for preview?如果您想更改您在照片预览视图中的叠加,请在此处查看我的答案: 相机叠加视图 - 仅用于预览?

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

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