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,我想关闭滚动,但我也想保留缩放功能。
UIScrollView
当我 makescrollView.scrollEnabled = NO时,它会关闭滚动,但缩放也消失了。
scrollView.scrollEnabled = NO
文档说:
禁用滚动时,滚动视图不接受触摸事件;它将它们转发到响应者链上。
您可以尝试将UIScrollView's设置contentSize为bounds有效禁用滚动?
contentSize
bounds