Re: [問題] Custom UIImagePickerController
第一種:
直接把不需要接收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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 4 之 8 篇):