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.
如何在动画上画一条线跟随球,比如Discovr应用程序?
我想做一个像Discovr这样的应用程序,让一些球漂浮并通过线连接。
球移动时如何重绘线条?
我用UIView Animation在球上。
UIView Animation
谢谢。
我建议使用 CAShapeLayer。形状图层采用 CGPath,只要更改后的路径包含相同数量的点/线/弧,就会对路径进行动画更改。
您可以为球的运动设置动画,并为形状图层创建动画更改,同时移动线条的端点。