强制uiscrollview即使单个项目也可以反弹滚动 [英] Force uiscrollview to bounce scrolling even with a single item

查看:68
本文介绍了强制uiscrollview即使单个项目也可以反弹滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIScrollView,其中包含不同数量的项目/子视图.如果有多个项目,则滚动弹跳有效.但是,有时滚动视图只应包含一个项目,我想向用户提供反馈,告知他们的滚动已被识别-从而产生反弹效果.但是,UIScrollView禁用仅滚动一项.

I have a UIScrollView with varying numbers of items/subviews. When there is more than one item, scrolling bounce works. However, there are times when the scrollview should only have one item, and I would like to provide the feedback to the user that their scrolls are being recognized--thus the bounce effect. However, UIScrollView disables scrolling with just one item.

推荐答案

答案:将alwaysBounceHorizo​​ntal或alwaysBounceVertical设置为true.在撰写本文时,我回答了自己的问题,并认为我不妨将其发布以帮助他人.

Answer: set alwaysBounceHorizontal or alwaysBounceVertical to true. I answered my own question while writing this up and figured I might as well post it to help others.

这篇关于强制uiscrollview即使单个项目也可以反弹滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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