`
toyota2006
  • 浏览: 552352 次
  • 性别: Icon_minigender_1
  • 来自: 石家庄
社区版块
存档分类
最新评论

iPhone/iPad 动画效果切换画面

阅读更多
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 *sv = [[StartView alloc]initWithNibName:@"StartView" bundle:nil];
//			self.startView=sv;
//			[sv release];			
			[self.myview insertSubview:startView.view atIndex:0];
		}
}
	
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics