zoukankan      html  css  js  c++  java
  • iphone view与view翻转的动画效果

    - (void)onSwitchViews:(id)sender  

    {  

    if (secondViewController == nil)  

    {  

    ContitionSelectorPage *tempViewController = [[ContitionSelectorPage alloc] initWithFrame: CGRectMake(0, 44, self.view.frame.size.width,  self.view.frame.size.height-44) ];                  

    secondViewController = [tempViewController retain];  

    [tempViewController release];  

    }  

    [UIView beginAnimations:@"View Flip" context:nil];  

    [UIView setAnimationDuration:1.25];  

    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  

    UIViewController *coming=nil;  

    UIViewController *going=nil;  

    UIViewAnimationTransition transition;  

    if (firstViewController.view.superview == nil)   

    {          

    coming=firstViewController;  

    going=secondViewController;  

    transition=UIViewAnimationTransitionFlipFromRight;                  

    }  

    else  

    {  

    coming=secondViewController;  

    going=firstViewController;  

    transition=UIViewAnimationTransitionFlipFromLeft;  

    }  

    [UIView setAnimationTransition:transition forView:self.view cache:YES];  

    [coming viewWillAppear:YES];  

    [going viewWillDisappear:YES];  

    [going.view removeFromSuperview];  

    [self.view insertSubview:coming.view atIndex:0];  

    [coming viewDidAppear:YES];  

    [going viewDidDisappear:YES];  

    [UIView commitAnimations];  

    }  

  • 相关阅读:
    1006: [HNOI2008]神奇的国度
    1003: [ZJOI2006]物流运输trans
    Task 6.2冲刺会议六 /2015-5-19
    Task 6.2冲刺会议五 /2015-5-18
    Task 6.2冲刺会议四 /2015-5-17
    Task 6.3 场景调研
    Task 8 找水王
    Task 6.2站立会议三
    Task 6.2站立会议二
    Task 6.2站立会议一
  • 原文地址:https://www.cnblogs.com/luyinghuai/p/2103127.html
Copyright © 2011-2022 走看看