UIViewController transition - objective-c

前端 未结 4 957
盖世英雄少女心
盖世英雄少女心 2021-01-03 02:36

I have UIViewControllers A and B, they are allocated in AppDelegate. I need to apply transition to them. How to transit them without reallocating a

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 03:21

    I found solution for my problem. This code works on iOS 4.x

    [UIView beginAnimations:@"transition" context:nil];
    [UIView setAnimationDuration:1.0];
    
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown 
                 forView:self.navigationController.view 
                   cache:NO];
    
    [self.navigationController 
    pushViewController:self.alternateView animated:NO];
    
    [UIView commitAnimations];
    

提交回复
热议问题