您的位置:首页 > 移动开发 > IOS开发

iOS之exit(0)动画退出应用程序

2012-12-05 22:18 393 查看
-(void)animationFinished:(NSString*)animationid finished:(NSNumber*)finished
context:(void*)context
{
if ([animationid
compare:@"exitApplication"]==0) {
exit(0);// 退出应用程序
NSLog(@"stop");
}
}
-(IBAction)exit:(id)sender
{
[UIViewbeginAnimations:@"exitApplication"context:nil];
//动画名称

[UIViewsetAnimationDuration:6];

[UIViewsetAnimationDelegate:self];

[UIViewsetAnimationTransition:UIViewAnimationCurveEaseInOutforView:self.viewcache:NO];
// 动画方式

//动画结束执行的操作
[UIVie setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];

self.view.bounds=CGRectMake(0,0,
0, 0);//动画结束

[UIViewcommitAnimations];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: