天天看點

ios 中UIScrollView如何同時響應scrollViewDidScroll 與 touchesMoved等事件

1.繼承UIScrollView,在其子類中實作下面的這個方法,在這個方法中寫上在touch之後要完成的功能即可

- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view

2.touchesShouldBegin方法的event需要有事件響應,可以傳入UIButton等事件

ios 中UIScrollView如何同時響應scrollViewDidScroll 與 touchesMoved等事件
ios 中UIScrollView如何同時響應scrollViewDidScroll 與 touchesMoved等事件

3.Demo位址:http://download.csdn.net/detail/take8619702/4656300