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.
大家好,我正在尝试制作一个包含大量动画和效果的交互式 UI。
但我不知道是否:
核心图形可以支持用户交互(触摸、拖动等)
核心图形支持对象旋转
Core graphics 可以以任何方式与 UIKit 和 Core Animation 交互
谢谢!
假设您在谈论 iPhone 而不是 Mac(因为提到了触摸)。
1) CoreGraphics 主要与绘制图像有关。用户交互是通过您的视图和 touches* 成员函数进行的。在视图的 drawRect 函数中,您可以使用 CoreGraphics 进行自定义绘图。
2) 是的,您可以获得旋转,但最简单的方法是使用 CGAffineTransformMakeRotation 设置变换属性。下拉到图层,你甚至可以使用 3d 变换(我认为这就是他们如何做像覆盖流这样的事情)。
3) 见#1。