为什么在 iOS 模拟器中 UIScrollView 无法滚动? [英] Why does the UIScrollView could not be scrolled in the iOS simulator?
问题描述
我正在尝试熟悉 UIScrollView
.我尝试将 UIScrollView 的 contentSize
设置为屏幕的 full width
和 十倍
屏幕的 heigh
t在相应的 ViewController 的 viewDidLoad
方法中.但是,当我尝试在 iOS 模拟器
上运行它时,我发现视图无法滚动
.请帮助提供一些提示&意见.
I'm trying to get familiar with the UIScrollView
. I try to set the UIScrollView's contentSize
to full width
of the screen and ten times
the heigh
t 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.
谢谢!
推荐答案
你需要签入你的代码 查看
You need To check in your Code See
1)检查是否为UIScrollView
启用了UserInteraction,如果没有请按
1)Check whether the UserInteraction enabled For The UIScrollView
if not Please Do as
[theScrollView setUserInteractionEnabled:YES];
编辑
2)请确保您已启用UIScrollView
theScrollView.scrollEnabled = YES;
谢谢.
这篇关于为什么在 iOS 模拟器中 UIScrollView 无法滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!