8

在我的项目中,我正在使用页面动画。我的问题是我想在卷曲视图的背景上显示红色。我该如何做到这一点?提前致谢。

在此处输入图像描述

CATransition *animation = [CATransition animation];
[animation setDelegate:self]; [animation setDuration:0.75];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageUnCurl"; 
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.65; 
[animation setRemovedOnCompletion:NO];
[[self view] exchangeSubviewAtIndex:[self.view.subviews count]-2 withSubviewAtIndex:3];
[[self view] exchangeSubviewAtIndex:[self.view.subviews count]-3 withSubviewAtIndex:2];
[[[self view] layer] addAnimation:animation forKey:@"pageCurlAnimation"];

这就是我改变看法的方式。

4

5 回答 5

1

如果您正在使用图层,那么当应用程序进入后台进程时,您可以放松该特定图层的卷曲效果。

于 2013-04-04T06:08:59.487 回答
1

如果在动画发生时使用 CALayer 作为背景页面,这是可能的。

topPageReverseOverlay = [[CALayer alloc] init];
topPageReverseOverlay.backgroundColor = [[[UIColor redColor] colorWithAlphaComponent:0.8] CGColor];
于 2013-01-09T08:57:14.363 回答
0

如果您想完全控制部分卷曲背后的内容的显示,您可以将其设置为单独的 VC。这是一个例子:

EndPartialCurlViewController *nextViewController = [[EndPartialCurlViewController alloc] init];
[nextViewController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[[self navigationController] presentViewController:nextViewController animated:YES completion:nil];

然后,您可以在此 EndPartialCurlViewController 中构建您想要的任何颜色、视图、按钮等。

于 2012-12-20T01:43:06.020 回答
0

我相信您的问题的答案可以在此线程中找到。 使用 UIViewAnimationTransitionCurlUp 的卷曲视图的底面颜色

于 2012-12-26T10:39:50.063 回答
0

经过大量冲浪后,我发现有一种方法可以通过使用过滤器和图层来实现,但这是一种未记录的方法,如果您使用图层,那么当应用程序进入后台进程时,您可以放松该特定图层的卷曲效果..

于 2013-04-25T09:58:31.760 回答