开发者

UIScrollView user interaction

开发者 https://www.devze.com 2023-03-11 21:16 出处:网络
I have a UIScrollView where I have a button. I need that scrollview isblocked. (much larger than the scree开发者_如何学Pythonn) . To do this I did:

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

精彩评论

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

关注公众号