Question

I have subview inside UINavigationcontroller rootview, what is the best way to animate and resize it to full screen? i'm using UIPinchGestureRecognizer for this subview and [UIView animateWithDuration] method, but the size of view doesn't change.

Was it helpful?

Solution

Do the following

- (IBAction) didPinch:(UIButton*)button
{
    UIView *yourView; //this is the view you want to expand

    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1];
    yourView.frame = [[UIApplication sharedApplication].windows.lastObject frame];
    [UIView commitAnimations];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top