Why does the UIScrollView could not be scrolled in the iOS simulator?

时光毁灭记忆、已成空白 提交于 2019-12-11 05:05:47

问题


I'm trying to get familiar with the UIScrollView. I try to set the UIScrollView's contentSizeto full width of the screen and ten times the height of the screen in the corresponding ViewController's viewDidLoad method. However, when I tried to run it on the iOS simulator, I found that the view can't be scrolled. Please kindly help to give some hints & opinion.

Thanks!


回答1:


You need To check in your Code See

1)Check whether the UserInteraction enabled For The UIScrollView if not Please Do as

     [theScrollView setUserInteractionEnabled:YES];

EDIT

2)Please Make Sure You have Enabled The Scrolling of UIScrollView

     theScrollView.scrollEnabled = YES;

Thanks.



来源:https://stackoverflow.com/questions/13392867/why-does-the-uiscrollview-could-not-be-scrolled-in-the-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!