Adding view to UIScrollView and toggling scrolling/interacting
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!
- This is the proper way.
- On the scrollView,
setScrollEnabled:
to turn off scrolling.
精彩评论