Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个很长的水平 UIScrollView,我想让它在某些特殊情况下停止并反弹。有没有办法在不改变内容长度的情况下做到这一点?
编辑:我不希望它滚动到某个位置,我只想让它表现得好像它在某个地方碰到了它的边界。
您可以使用以下方法使滚动视图反弹:
//scroll is an instance of UIScrollView scroll.alwaysBounceVertical/Horizontal = YES;
scrollRectToVisible:animated:如果要滚动到特定位置,可以使用方法
scrollRectToVisible:animated: