作者sinread (电脑真耗钱)
看板MacDev
标题Re: [问题] Custom UIImagePickerController
时间Thu Sep 26 11:17:52 2013
※ 引述《s8911124 (-.-)》之铭言:
: 第一种:
: 直接把不需要接收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送。
: }
鲁蛇我简化一下我想做到的功能:
1. A 是 B的 subview, 并且A 和 B的frame 完全一样大小 ( A完全把B盖住 )
2. A 需要对 touch 事件有反应, 并且 "同时" B也要有反应
在s8911124的第二种方式下, A 跟 B只能同时有一个有反应,
但是鲁蛇我想要两个"同时"都有反应
请问这样可以做到嘛 ????
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.219.69.157
※ 编辑: sinread 来自: 61.219.69.157 (09/26 11:18)
1F:推 darktt:答案是不行,AVFoundation 是唯一解。 09/26 19:19