UIView 效果
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve: UIViewAnimationCurveLinear];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:2];
[self.view setAlpha:0.0];
[UIView commitAnimations];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve: UIViewAnimationCurveLinear];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[self.view setAlpha:1.0];
// [loginViewController.view setFrame:CGRectMake(0, 20, 320, 480)];
// TODO:中间可以修改很多东西,在这个view范围内
// 比如改变 scrollview 大小
// scrollView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f);
// [self addChildViewController:loginViewController];
[UIView commitAnimations];
如:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.3];
[scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)];
[UIView commitAnimations];
CALayer 旋转效果:
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(25.0f, frame.size.height - 65.0f, 30.0f, 55.0f);
layer.contentsGravity = kCAGravityResizeAspect;
layer.contents = (id)[UIImage imageNamed:@"blueArrow.png"].CGImage;
[[self layer] addSublayer:layer];
[CATransaction begin];
[CATransaction setAnimationDuration:FLIP_ANIMATION_DURATION];
layer.transform = CATransform3DMakeRotation((M_PI / 180.0) * 180.0f, 0.0f, 0.0f, 1.0f);
[CATransaction commit];
把layer 加入到 UIView 里面,实现层的旋转动画效果。
摘自 diqun1314的专栏
相关新闻>>
- 发表评论
-
- 最新评论 更多>>