为什么在 iOS 模拟器中 UIScrollView 无法滚动? [英] Why does the UIScrollView could not be scrolled in the iOS simulator?

查看:24
本文介绍了为什么在 iOS 模拟器中 UIScrollView 无法滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试熟悉 UIScrollView.我尝试将 UIScrollView 的 contentSize 设置为屏幕的 full width十倍 屏幕的 height在相应的 ViewController 的 viewDidLoad 方法中.但是,当我尝试在 iOS 模拟器 上运行它时,我发现视图无法滚动.请帮助提供一些提示&意见.

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.

谢谢!

推荐答案

你需要签入你的代码 查看

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆