开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜