简体   繁体   English

可见的UIScrollView内容然后反弹

[英]UIScrollView content visible then bounces away

I have a pretty simple UIScrollView defined inside Interface Builder. 我在Interface Builder中定义了一个非常简单的UIScrollView。 I've pasted in some UILabels and when I run my app, I can drag to see the UILabels at the bottom but as soon as I let go it bounces away from view. 我粘贴了一些UILabels,当我运行应用程序时,可以拖动以查看底部的UILabels,但是一旦松开它,它就会从视图中弹开。

What property controls this sort of setting? 什么属性控制这种设置?

The contentSize property should do the trick. contentSize属性应该可以解决问题。 Don't forget about the docs . 不要忘记文档

For the bounce effect there is a bounces property for UIScrollView which controls this... 对于弹跳效果, UIScrollView有一个bounces属性,可控制此属性...

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/instp/UIScrollView/bounces http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/instp/UIScrollView/bounces

And has been mentioned by Ian Henry contentSize should control the size of your scrollable area. 并已被Ian Henry提及, contentSize应该控制可滚动区域的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM