作者s8911124 (-.-)
看板MacDev
标题Re: [问题] Custom UIImagePickerController
时间Thu Sep 26 11:01:40 2013
第一种:
直接把不需要接收touch事件的view
view.userInteractionEnabled = NO;
第二种:
如果你的view有时候要接收touch有时候不接收,
你要在 pickerctl.view的 uiview class里面覆写
//Returns the farthest descendant of the receiver in the view hierarchy
(including itself) that contains a specified point.
- (UIView *)hitTest:(CGPoint)point withEvent(UIEvent *)event
{
UIView *hitView = [super hitTest:point withEvent:event];
//如果你觉得这个hitview要能回应 touch 的事件,就把它传出去
否则就return nil, 系统会在往parent view送。
}
: =========== 以下超鲁蛇小弟的假想 ===========
: [pickerctl.view addSubview:某个uiview];
: 然後再 某个uiview 中的
: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
: {
: [super touchesBegan:touches withEvent:event];
: // 要做的事情
: }
: ps. 回报一下刚刚超鲁蛇小弟测试的结果, 这样无法触动
: uiimagepickercontroller 的自动对焦
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.163.14.73