隐藏UIImagePickerControllerSourceTypceCamera工具栏,但特定按钮? [英] Hide UIImagePickerControllerSourceTypceCamera toolbar, but specific buttons?

查看:121
本文介绍了隐藏UIImagePickerControllerSourceTypceCamera工具栏,但特定按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使我的自定义工具栏在我的 UIImagePickerControllerSourceTypeCamera ,我必须关闭相机控件,如下:

In order to make my custom toolbar in my UIImagePickerControllerSourceTypeCamera, I have to turn off the camera control like this:

pickerOne.showsCameraControls = YES;

我想显示缩放,闪光灯,切换相机,并专注于 UIImagePickerController ,但我想创建我的自定义视图。当添加我的自定义视图时,只有当我关闭 cameraControls 时才显示。

I want to show the zoom, flash, switch cameras, and focus on the UIImagePickerController, but I want to create my custom view. When adding my custom view, it only shows up if I turn off the cameraControls.

不隐藏相机控件,并使我的自定义视图?

Is there any way to not hide the camera controls and make my custom view? Or will I have to manually add those buttons in?

推荐答案

您可以通过检查接收视图来忽略重叠式视图的触摸hittest方法。只要将此代码添加到您的重叠式视图中,该视图上的所有触摸都将被忽略,而不会忽略其子视图上的触摸。

You can ignore the touches on your overlayview by checking the receiving view in the hittest method. Just add this code to your overlay view, than all touches on that view will be ignored, but not the ones on its subviews.

-(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    id hitView = [super hitTest:point withEvent:event];
    if (hitView == self) return nil;
    else return hitView;
}



如果今天在stackoverflow上阅读,但我不记得在哪里,sry 。

If read this today on stackoverflow, but i don't remember where, sry.

这篇关于隐藏UIImagePickerControllerSourceTypceCamera工具栏,但特定按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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