84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
button添加到ScrollView上,点击效果没了。通过设置ScrollView.delaysContentTouches = NO;点击效果回来了,但是button区域的滑动ScrollView失效。因为button较多所以设置上面的那个不行 有没有好的解决办法。
认证高级PHP讲师
1、定一個UIScrollView類,重寫以下方法
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesBegan:touches withEvent:event]; [super touchesBegan:touches withEvent:event]; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesMoved:touches withEvent:event]; [super touchesMoved:touches withEvent:event]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [[self nextResponder] touchesEnded:touches withEvent:event]; [super touchesEnded:touches withEvent:event]; }
這樣就可以獲取到button 的點擊事件了,具體是因為什麼給你個鏈接即看一下 鏈接描述
能不能在 scrollView 上放個 view
1、定一個UIScrollView類,重寫以下方法
這樣就可以獲取到button 的點擊事件了,具體是因為什麼給你個鏈接即看一下
鏈接描述
能不能在 scrollView 上放個 view