0
我在課堂上有兩種方法,每種都有動畫。我的問題是,我可以將這些動畫存儲在一個數組中或通過beginAnimation引用它們:name?如果是的話,我該怎麼做?如何在obj-c中存儲動畫?
感謝您的幫助
-(void)hideMenu{
[UIView beginAnimations:@"HIDE_MENU" context:nil];
[UIView setAnimationDuration:0.38];
[UIView setAnimationDelay:0.12];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationBeginsFromCurrentState:YES];
self.frame = CGRectMake(0, -1 * self.frame.size.height, self.frame.size.width, self.frame.size.height);
[UIView commitAnimations];
}
-(void)showMenu{
[UIView beginAnimations:@"SHOW_MENU" context:nil];
[UIView setAnimationDuration:0.38];
[UIView setAnimationDelay:0.12];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationBeginsFromCurrentState:YES];
self.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
[UIView commitAnimations];
}
-(void)handleShowMenu:(NSNotification*)note{
[self showMenu];
}
-(void)handleHideMenu:(NSNotification*)note{
[self hideMenu];
}
謝謝你,我閱讀了Core Animation。 – 2011-12-14 07:28:56