iPhone/iPad 动画效果切换画面
程序员文章站
2022-05-04 07:52:40
...
iPhone/iPad 动画效果切换画面
-(void)switchView{
if (self.startView.view.superview!=nil) {
if (self.flagView!=nil) {
[self.flagView release];
}
self.flagView=[[FlagView alloc]initWithNibName:@"FlagView" bundle:nil];
//NSString *modeKBN =[self getOptionValue:@"modeKBN"];
//NSLog(@"modeKBN:%@",modeKBN);
//if ([modeKBN compare:@"2"]==0) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.myview cache:YES];
[UIView setAnimationDuration:0.8];
//soundDelayPlay为动画效果完成后执行的函数
[UIView setAnimationDidStopSelector:@selector(soundDelayPlay)];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
//}
[startView.view removeFromSuperview];
[self.myview insertSubview:flagView.view atIndex:0];
}else {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.myview cache:YES];
[UIView setAnimationDuration:0.8];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
[flagView.view removeFromSuperview];
[flagView viewDidDisappear:NO][StartView alloc]nitWithNibName:@"StartView" bundle:nil];
// self.startView=sv;
// [sv release];
[self.myview insertSubview:startView.view atIndex:0];
}
}
上一篇: 邮件**
下一篇: 配置JDK的环境变量