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.
我的 iPad 应用程序中有很多小的可拖动子视图。我还有一个具有清晰颜色背景的顶级非透明子视图。它有屏幕尺寸。用户交互被禁用。在拖动底部子视图之一时,我需要重绘该顶部子视图。我在那个顶部子视图上画了一些线。它们必须根据当前底部子视图位置重新绘制。我想实现平滑拖动,但目前我做不到。目前,我在底部子视图的 panMoved 中发送了很多 setNeedsDisplayInRect 到顶部视图。如何更好地做到这一点?
最好使用顶部子视图的 CALayer 进行绘图。它更有效。