iOS 動畫退出應用代碼


//退出應用app

- (void)appExit{ide

    UIButton *but = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 30)];spa

    [but setTitle:@"退出此應用" forState:UIControlStateNormal];3d

    [but setTitleColor:[UIColor redColor] forState:UIControlStateNormal];orm

    [self.view addSubview:but];ip

    [but addTarget:self action:@selector(didClicked:) forControlEvents:UIControlEventTouchUpInside];get

}animation


- (void)didClicked:(id)sender{it

        [UIView beginAnimations:@"exitApplication" context:nil];io

        [UIView setAnimationDuration:0.5];

        [UIView setAnimationDelegate:self];

        [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];

        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view.window cache:NO];

        [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];

        self.view.window.bounds = CGRectMake(0, 0, 0, 0);

        [UIView commitAnimations];

}

相關文章
相關標籤/搜索