Saturday 21 April 2012

change frame size with animation like Ex..


///Example 1

[UIView beginAnimations:nil context:NULL];
            [UIView setAnimationDuration:0.2];
            
            for (UIView *view in [self.view subviews]) { 
                
                
                if ([view class] == [UIButton class]|| [view class] == [UIImageView class]){
                    view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y - 27, view.frame.size.width, view.frame.size.height);
                }
                
            }
            [UIView commitAnimations];

////Example -2

 UIView *myView = self.view;
               
               [UIView beginAnimations:nil context:NULL];
               [UIView setAnimationDuration:0.3];
               CGRect newFrame = myView.frame;
               newFrame.size.height = newFrame.size.height -[self getBannerHeight];
               myView.frame = newFrame;
       [UIView commitAnimations];

No comments:

Post a Comment