Re: [問題] Custom UIImagePickerController

看板MacDev作者 (-.-)時間10年前 (2013/09/26 11:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/8 (看更多)
第一種: 直接把不需要接收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
文章代碼(AID): #1IGwEQ2s (MacDev)
討論串 (同標題文章)
文章代碼(AID): #1IGwEQ2s (MacDev)