子视图调整为全屏

时间:2012-06-07 06:49:49

标签: ios uiview uinavigationcontroller uipinchgesturerecognizer

我在UINavigationcontroller根视图中有子视图,动画并将其调整为全屏的最佳方法是什么?我正在为这个子视图和[UIView animateWithDuration]方法使用UIPinchGestureRecognizer,但视图的大小不会改变。

1 个答案:

答案 0 :(得分:1)

执行以下操作

- (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];
}