UInavigationController自定义动画显示白色背景iphone

时间:2012-04-26 10:23:41

标签: iphone uinavigationcontroller core-animation

我想在uinavigation控制器中实现自定义动画。 我用

完成了
 CATransition* transition = [CATransition animation];
    transition.duration = 0.20f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
    transition.type = kCATransitionMoveIn;
    transition.subtype = kCATransitionFromTop;
    [self.navigationController.view.layer addAnimation:transition
                                                forKey:kCATransition];
    [self.navigationController pushViewController:viewController animated:NO];

但是当视图控制器弹出时,它会显示一个白色的bacground。如何删除它 由于一些问题,我暂时无法使用presentmodelviewcontroller

1 个答案:

答案 0 :(得分:0)

我不是告诉你这样做的,但你也可以尝试这种方式。,。,

view2 *vw2=[[view2 alloc]initWithNibName:@"view2" bundle:nil];
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.80];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight 
                       forView:self.navigationController.view cache:NO];
[self.navigationController pushViewController:vw2 animated:NO];

//    [self.navigationController pushViewController:aboutShowViewController animated:YES];
[UIView commitAnimations];

CATransition *transition = [CATransition animation];
transition.duration = 1.0f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;

[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:vw2 animated:NO];

它可能对你有所帮助。,。

我正在学习。,。,。