yel*_*low 5 animation core-animation objective-c uiviewanimation ios
在UIViewAnimationCurve只有
这些功能.
但是,我需要像UView的ExpoOut,BackInOut动画.
像ExpoOut一样 [CAMediaTimingFunction functionWithControlPoints:0.12 :0.51 :-0.4 :1];
我使用过CABasicAnimation,但它不能像UIView动画一样改变帧,改变视图大小时非常糟糕.
或者,你有没有更好的方法来改变像真实的视图框架,而不是像zoomin.
谢谢.
这里的一个问题是不可能为基于 UIView 的动画指定计时函数。据我所知,您将面临一系列令人不快的选择:
\n\n我通过在动画之前将委托设置为 nil 并在之后设置回 UIView 来破解我的方法,但感觉很脏。不过,我可能错过了一些东西。我的代码看起来像这样:
\n\n- (void)methodThatAnimates {\n [CATransaction begin]; {\n /* Must set to nil, otherwise the view just jumps to the new location. */\n self.viewToAnimate.layer.delegate = nil;\n\n CAMediaTimingFunction *timingFunction = \n [CAMediaTimingFunction functionWithControlPoints:0.4 :0 :0 :1.0];\n [CATransaction setAnimationTimingFunction:timingFunction]\n self.viewToAnimate.layer.position = CGPoint(15.0, 0.0);\n\n /* Set delegate back to the view, as is required per the \n Apple documentation. */\n self.viewToAnimate.layer.delegate = self.viewToAnimate;\n } [CATransaction commit];\n}\nRun Code Online (Sandbox Code Playgroud)\n\n到目前为止,它似乎很有魅力,但由于暂时为零的代表,我一直期待一些奇怪的工件出现。
\n| 归档时间: |
|
| 查看次数: |
4604 次 |
| 最近记录: |