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,我想在它滚动时反弹,但目前它能够反弹,尽管内容大小与框架相同。如果内容大小和框架大小相同,如何阻止它弹跳?有没有比通过检查覆盖 setContentSize 和 setFrame 更优雅的方法?
你可以检查一下
if(scrollView.contentSize==frame.size) { scrollView.bounce = NO; } else { scrollView.bounce = YES; }
使用 KVO 监听内容大小的变化。