iphone - 如何在 Notes iPad 应用程序中重新创建动画?

标签 iphone objective-c cocoa-touch core-animation

当您在横屏模式下使用 iPad 笔记应用程序(来自 Apple)时,您会在左侧看到笔记列表。如果您选择一个笔记,您会看到一个漂亮的小动画,看起来就像有人正在用红色铅笔在笔记上做标记。

我已经有了一个看起来像那个红色圆圈的图形,但我该如何将它制作成那样的动画呢?提前谢谢你。

编辑 1
这是图形的链接:red circle

最佳答案

我实际上并不知道你在谈论的动画,但假设我了解它的作用,那么一个简单的方法是使用内置的 UIImageView 支持来显示一系列图像作为动画。然后,您需要为每一帧单独的图像。

NSArray* imageFrames = [NSArray arrayWithObjects:[UIImage imageNamed:@"frame1.png"],
                                                 [UIImage imageNamed:@"frame2.png"],
                                                 [UIImage imageNamed:@"frame3.png"],
                                                 [UIImage imageNamed:@"frame4.png"],
                                                 nil];
UIImageView* imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,100,100)];
[imageView setAnimationImages:imageFrames];
[imageView setAnimationDuration:10];
[imageView setAnimationRepeatCount:3];

上面创建了一个 UIImageView,它有 4 个帧,动画超过 10 秒。动画重复 3 次。

参见 UIImageView documentation获取更多信息。

显然,您实际上需要一系列图像来制作动画。

关于iphone - 如何在 Notes iPad 应用程序中重新创建动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3850745/

相关文章:

ios - 我应该在哪里放置检查它是否为 iphone 5 的 bool 方法?

iPhone 团队配置文件 - 无效

iphone - 自定义可点击对象(按钮)IOS - Objective C (Xcode5)

iphone - 使用#pragma 消息时如何禁用警告?

ios - CompoundPredicate NSPredicate

iphone - UILabel 未使用另一个类的值进行更新

ios - 此iPhone运行的是iOS 12.0(16A366),此版本的Xcode可能不支持

objective-c - Objective C : Version of JSON library I'm compiling in present in another library I'm linking in via . a,如何解决冲突?

iphone - UITableViewCell 中复选标记的问题

iphone - 设备运动更新的实际频率低于预期,但会随着设置而增加