Showing posts with label UI Animation. Show all posts
Showing posts with label UI Animation. Show all posts

Wednesday, January 4, 2012

iPhone UIView Animation Best Practice


You can use this method to animate a view, when changing 'yValue'.  And you can change animation curve, when changing '  [UIView setAnimationCurve:UIViewAnimationCurve..................];'



- (void)animationView:(int)yValue
{
    [UIView beginAnimations:@"View Flip" context:nil];
    [UIView setAnimationDuration:0.50];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
       
   
    CGRect frame = veriableNameOfView.frame;
    frame.origin = CGPointMake(0, yValue);
    veriableNameOfView.frame = frame;
   
    [UIView commitAnimations];
}