views:

246

answers:

1

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!

+2  A: 
  1. This is the proper way.
  2. On the scrollView, setScrollEnabled: to turn off scrolling.
Steven Canfield