1
我正在使用滾動視圖和該滾動視圖我有UIIMageview和UITextview.My問題是-i想要Textview的Touchevent。UIScrollview + UItextview觸摸事件
我正在使用滾動視圖和該滾動視圖我有UIIMageview和UITextview.My問題是-i想要Textview的Touchevent。UIScrollview + UItextview觸摸事件
我認爲UIScrollView成爲觸摸事件的第一響應者,並且它不會將觸摸事件作爲默認傳遞給其他視圖。
那麼,爲什麼不創建UIScrollView的子類呢?然後,將子類所接收的所有觸摸事件傳遞給UIIMageview或UITextview,如下所示。
@implementation SubclassOfScrollView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.nextResponder touchesBegan:touches withEvent:event];
}
@end