2009-12-02 134 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; 
       }];