4
votes

When I set my UIScrollView to be the main view within Interface Builder, the scrolling works as expected. However, when I add the UIScrollView as a subview of UIView the scroll does not work.

So it seems my trouble begins when the UIScrollView is added as a subview to UIView.

The "User Interaction Enabled" it true for both view.

I though perhaps I might have to do something with in touchesBegan something lake passing the touches to the UIScrollView, but have not had much luck with that.

Has anyone seen this before?

2
Can you post some code ? Such as how you initialize the UIScrollView...delannoyk
What is the contentSize of your scroll view?Mark Granoff
Did u get the answer.? i am having the same problem.mAc

2 Answers

0
votes
scrollView.delegate = scrollView;  //or nil may work
0
votes

It's always good to show a complete working code snippet:

// in viewDidLoad: 

//UIScrollview *myScrollView;

UIView_descendent *contentView;
// scrollview won't scroll unless content size explicitly set

[myScrollView setContentSize:contentView.frame.size];

I have not found a way to set contentSize in IB.