iOS - UIScrollView is not working (it doesn#39;t scroll at all - the image stays fixed)(iOS - UIScrollView 不工作(它根本不滚动 - 图像保持固定))
本文介绍了iOS - UIScrollView 不工作(它根本不滚动 - 图像保持固定)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在图像视图中显示图像(宽度:320 像素,高度:1250 像素).
I would like to display an image (width: 320 pixels, height: 1250 pixels) in an image view.
当我编译应用程序时,我根本没有滚动.视图保持不变.
When I compile the application I get no scrolling at all. The view stays fixed.
我做了什么:
- 通过 Interface Builder 在我的视图中添加了一个
UIScrollView
. - 通过 Interface Builder 向我的视图添加了一个
UIImageView
. - 验证
UIImageView
在 Interface Builder 中位于UIScrollView
之下. - 使用
ViewDidLoad
设置UIScrollView
的大小.
- Added an
UIScrollView
via Interface Builder to my view. - Added an
UIImageView
via Interface Builder to my view. - Verified that
UIImageView
is belowUIScrollView
in Interface Builder. - Set the size of the
UIScrollView
withViewDidLoad
.
我该怎么做?
代码:
截图:
ImageView
:
ScrollView
:
推荐答案
我刚刚做了同样的任务..试试这个.....
I just have done the same task.. Try this one.....
也设置这个....
这篇关于iOS - UIScrollView 不工作(它根本不滚动 - 图像保持固定)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!