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.
在我的滚动视图中,我有大约 20 个 UIView,每个都有一个标签和按钮,每当我滚动时,滚动视图都会滞后。为什么是这样?可能是因为我在滚动视图中对 UIViews 进行了子分类吗?在我的视图控制器中创建 UIView 会更好吗?
您提供的信息远远不够,任何人都无法具体回答(例如,您根本没有提供任何信息)。但没有必要猜测。使用仪器并找出导致问题的原因。此外,对于一些非常有用的一般原则,以及使用 Instruments 调试慢速滚动的一些技术,请观看有关此主题的 WWDC 2012 视频,例如 Session 238 - iOS App Performance: Graphics and Animations。
您是否将数据同步加载到单元格中?