作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在开发一款 child 信件追踪应用程序 - 请参阅随附的屏幕截图。
我能够使用由字体字形标识的 bezierpath 显示字母,并允许在 bezierpath 内写入触摸。
现在,我想添加一个帮助动画,以便从头到尾显示如何写这封信。
怎么做?
考虑我们显示“A”,我想展示动画展示如何为 children 写“A”。
任何指示/想法。
最佳答案
我在我的应用程序中使用了这个动画。创建了一个按顺时针方向填满圆点的圆形进度条
CABasicAnimation *pathAnim = [CABasicAnimation animationWithKeyPath: @"path"];
pathAnim.toValue = (id)newPath.CGPath;
// -- initialize CAAnimation group with duration of 0.2secs and beginTime will begin after another.
CAAnimationGroup *anims = [CAAnimationGroup animation];
anims.animations = [NSArray arrayWithObjects:pathAnim, nil];
anims.removedOnCompletion = NO;
anims.duration = 0.2f;
anims.beginTime = CACurrentMediaTime() + anims.duration*i;
anims.fillMode = kCAFillModeForwards;
[anims setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[progressLayer addAnimation:anims forKey:nil];
关于iOS:如何为 uibezierpath 中的填充设置动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31824383/
我是一名优秀的程序员,十分优秀!