【发布时间】:2012-03-01 06:53:27
【问题描述】:
我有 2 个视图控制器,我在第一个视图控制器中使用 AVAudioPlayer 播放音乐。 我转到第二个视图控制器并停止音乐:
[audioPlayer stop];
[UIView beginAnimations:@"Curl View" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[self.view addSubview:secondController.view];
[UIView commitAnimations];
当我再次回到第一个视图控制器时,我想再次播放我的音乐,但代码没有再次触及 viewDidLoad。 这是我返回的代码:
[UIView beginAnimations:@"Flipping View" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view.superview cache:YES];
[self.view removeFromSuperview];
[UIView commitAnimations];
请分享一些解决方案或之后代码执行的内容..提前谢谢
【问题讨论】:
标签: iphone ios uiview uiviewcontroller avaudioplayer