a UIScrollView works just fine by it’s self (in IB). However, once you put the UIScrollView inside of a UIVIew in IB, it no longer works. I’m doing this with no subclassing so what’s the deal?
Answer
- You have to make sure
Autoresize Subviewsis checked on the containingUIView. - The next part is a bit of a hack. You need to assign a new
frameto the containingUIViewas well. However, the newframeCANNOT be the pre-existing size of yourUIView. It must be a different size for this to work.
If you want the size contained on your UIView in InterfaceBuilder then you need to do something like this:
self.frame = CGRectMake(0,0,0,0);
self.frame = [put your desired rect size here];
Have you tried returning
NOintouchesBeganif the touch falls inside your scroll view’s frame?Edit:
Make sure you set the scroll view’s content size (
[[self scrollView] setContentSize:CGSizeMake(320,480)];– the values do not matter) and make sure you check “Bounce Horizontally” and/or “Bounce Vertically” (depending on which you want) as well as “Bounces”: