Force uiscrollview to bounce scrolling even with a

2019-06-15 18:37发布

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.

2条回答
一纸荒年 Trace。
2楼-- · 2019-06-15 19:22

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.

查看更多
我只想做你的唯一
3楼-- · 2019-06-15 19:33

Additionally, a UIScrollView will not scroll in (width / height) if the contentSize property is not greater than the frame property (in width / height)

查看更多
登录 后发表回答