UIScrollView user interaction
I have a UIScrollView where I have a button. I need that scrollview is blocked. (much larger than the scree开发者_如何学Pythonn) . To do this I did:
scrollView.userInteractionEnabled = NO;
but in doing so the button is not active.
there is a way to make it possible to interact with what's in the scrollview, but not to scroll?
thanks!
You could change the contentSize of the scrollView to a size smaller than the screen of the device. Then, the OS won't scroll simply because it has no need to. So instead of disabling user interaction, just change the content size to smaller. Then, instead of re-enabling interaction, just change the content size back to larger.
精彩评论