Bal*_*alu 8 iphone xcode objective-c ios
在我的项目中,我正在使用页面动画.我的问题是我想在卷曲视图的背景上显示红色.我如何实现这一目标?提前致谢.

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"];
Run Code Online (Sandbox Code Playgroud)
这就是我改变观点的方式.
如果您想完全控制部分卷曲后面内容的显示,可以将其设置为单独的 VC。这是一个例子:
EndPartialCurlViewController *nextViewController = [[EndPartialCurlViewController alloc] init];
[nextViewController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[[self navigationController] presentViewController:nextViewController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
然后,您可以在这个 EndPartialCurlViewController 中构建任何您想要的颜色、视图、按钮等。
| 归档时间: |
|
| 查看次数: |
1002 次 |
| 最近记录: |