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 裏面,實現層的旋轉動畫效果。








發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章