0

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

4

1 回答 1

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];
}
于 2012-06-07T07:12:45.093 回答