0

I've created a scroll view, width less than the screen width and set clipsToBounds=YES. As the UIScrollView doesn't scroll from anywhere outside the range of its frame, I put the UIScrollview inside a UIView and tried to override the "(UIView *)hitTest:WithEvent:" method. But it always shows warning pointInside method not found (or something like that) in the if ([self pointInside:point withEvent:event]) line and it doesn't work. What did I do wrong? Thanks in advance...

x4h1d
  • 6,042
  • 1
  • 31
  • 46

2 Answers2

0

You have to change the ScrollView's contentSize in order to allow the ScrollView to scroll. It will only scroll it the contentSize.x is bigger than scrollview.size.x and/or contentSize.y bigger than scrollview.size.y.

Bruno Koga
  • 3,864
  • 2
  • 34
  • 45
  • @Koga, my ScrollView scrolls just fine. I've no problem with scrolling. I want to control the ScrollView from the outside of the view frame using hitTest method. And my hitTest method doesn't work. Any solution? – x4h1d Jun 19 '12 at 02:42
0

Answering my own question, the problem is I didn't create the UIVIew subclass to override the (UIView *)hitTest:WithEvent: while the UIScrollView was in a subview of self.view. So, it is important to check which view inherits the scroll view and write overridden method in the parent view class.

x4h1d
  • 6,042
  • 1
  • 31
  • 46