gpt4 book ai didi

iphone - 如何在没有任何透明/淡入淡出效果的情况下执行 kCATransitionPush 动画

转载 作者:太空狗 更新时间:2023-10-30 03:38:26 29 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
iPhone CATransition adds a fade to the start and end of any animation?

我正在尝试复制 [UIViewController presentModalViewController:animated:] 执行的“从底部向上滑动”动画,但没有调用它,因为我不想要模态视图。

下面的核心动画代码非常接近,但似乎在其中改变了 View 的透明度值。在动画开始时,您可以部分地看到向上滑动的 View 。在动画的中间/结尾,我们滑过的 View 是完全透明的,所以我们可以看到它后面。我希望在这个动画期间两者都保持完全不透明。

关于如何停止此代码中的透明度更改或以其他方式获得我正在寻找的“向上滑动动画”而不需要模态视图的任何想法?

UIViewController *nextViewController = [[UIViewController alloc] autorelease];
nextViewController.view.backgroundColor = [UIColor redColor];
CATransition *animation = [CATransition animation];
animation.duration = 3.5;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionPush;
animation.subtype = kCATransitionFromTop;
[self.navigationController pushViewController:nextViewController animated:NO];
[self.navigationController.view.layer addAnimation:animation forKey:nil];

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com