在相机覆盖层上使用标准相机按钮 (iPhone)
我在应用程序的相机视图上使用Overlay
。问题是,我想使用标准的相机按钮 - 点击即可拍照的长椭圆形按钮。
有没有办法将椭圆形相机按钮添加到我的叠加层中?
I am using an Overlay
on the camera views in my app. 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
减小覆盖视图大小,使其不会隐藏相机按钮工具栏。
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.
只需将您的叠加视图的 userInteractionEnabled 设置为 false 即可。然后与相机的所有交互都会像以前一样。
//编辑:同时使overlayview透明。在该视图的顶部添加视图,您希望显示为叠加视图,但将其调整为所需的小值,以免隐藏默认的相机按钮。如果您想更改照片预览视图中的叠加,请在此处查看我的答案:相机叠加视图 - 仅用于预览?
Just set userInteractionEnabled to false for your overlayview. Then all interaction with the camera will behave like it did before.
//edit: also make the overlayview transparent. 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?