2009-12-02 86 views

回答

1

这里是代码:

[UIView beginAnimations:@"hideView" context:nil]; 
[UIView setAnimationDuration:0.7]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:toolBar cache:YES]; 
toolbarFrame.origin.y = 380; 
toolBar.frame = toolbarFrame; 
[UIView commitAnimations]; 

您可以修改工具栏 'Y' 的起源。

8

使用块的示例。这会隐藏iPad屏幕顶部的工具栏。

[UIView animateWithDuration:.7 
       animations:^(void) 
       { 
        CGRect toolbarFrame = self.toolbar.frame; 
        toolbarFrame.origin.y = -44; // moves iPad Toolbar off screen 
        self.toolbar.frame = toolbarFrame; 
       } 
       completion:^(BOOL finished) 
       { 
        self.toolbar.hidden = YES; 
       }];