Fah*_*kar 9 animation menu objective-c uiscrollview ios
我有scrollview和内部scrollview我有2个视图作为MainView,另一个作为SideMenuView.
我想制作下面的动画.
知道需要做些什么来实现这个目标吗?
小智 3
伪代码如下:
- (void)animateSideMenu{
homeView.frame = CGRectMake(sideMenuWidth, 0.0, (self.view.frame.size.width - sideMenuWidth), self.view.frame.size.height);
[UIView animateWithDuration:1.0 delay:0.0
options:UIViewAnimationOptionCurveLinear
animations:^{
sideMenu.frame = CGRectMake(0.0, 0.0, sideMenuWidth, sideMenuHeight);
[self flipAnimation];
} completion:^(BOOL finished) {
}];
}
- (void)flipAnimation{
CABasicAnimation *yRotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
yRotate.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 0, 1, 0)];
yRotate.toValue = @(M_PI * 1.5);
yRotate.duration = 0.5;
yRotate.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
[sideMenu.layer addAnimation:yRotate forKey:@"yRotate"];
}
Run Code Online (Sandbox Code Playgroud)
以下是开发此类动画的步骤:
尝试一下,如果有任何问题请告诉我。
| 归档时间: |
|
| 查看次数: |
529 次 |
| 最近记录: |