Adding view to UIScrollView and toggling scrolling/interacting

Posted by Peter Hajas on Stack Overflow See other posts from Stack Overflow or by Peter Hajas
Published on 2010-03-17T22:46:54Z Indexed on 2010/03/17 22:51 UTC
Read the original article Hit count: 448

Hi all!

I have a UIScrollView in my project. I have a view controller I would like to add as a child of the UIScrollview. Would I just do that like this:

[scrollView addSubview:theViewController.view];

or is there a better way? (theView is a view, not the TV show)

Furthermore, I would like to be able to use a UIButton in scrollView's parent view controller to toggle whether or not the user is scrolling with scrollView and NOT interacting with theView or NOT scrolling with scrollview and interacting with theView. Should I just have that set the property:

scrollView.userInteractionEnabled = NO;

or would that disable interaction with theView because it's a child?

Thanks for your help!

© Stack Overflow or respective owner

Related posts about iphone-sdk-3.2

Related posts about iphone