UIViewAnimationTransitionCurlUp

UIViewAnimationTransitionCurlUp

本文介绍了使用UIViewAnimationTransitionCurlUp冰壶鉴于底面颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个可以自定义冰壶鉴于在UIViewAnimationTransitionCurlUp动画底部的颜色。默认似乎是灰色/白色,但我需要一个不同的。

Can one customize the underside color of curling view in a UIViewAnimationTransitionCurlUp animation. The default seems to be gray/white but i needed a different one.

推荐答案

据官方统计,没有。

非官方,您可以使用无证方法改变颜色 - 但它会导致你的应用程序被拒绝,如果你目标的AppStore,

Unofficially, you can change the color using undocumented methods – but it will cause your app to be rejected if you target for AppStore,

CAFilter* trans_filter = [CAFilter filterWithName:@"pageCurl"];
[trans_filter setValue:[NSArray arrayWithObjects:
                        [NSNumber numberWithFloat:1.0f],  // Red
                        [NSNumber numberWithFloat:0.0f],  // Green
                        [NSNumber numberWithFloat:0.0f],  // Blue
                        [NSNumber numberWithFloat:1.0f],  // Alpha
                        nil] forKey:@"inputColor"];
CATransition* trans = [CATransition animation];
trans.filter = trans_filter;
trans.duration = 2; // etc.
[the_superview_containing_the_transitions.layer addAnimation:trans
                                                      forKey:@"transition"];

[the_old_view removeFromSuperview];
[the_superview_containing_the_transitions addSubview:the_new_view];

这篇关于使用UIViewAnimationTransitionCurlUp冰壶鉴于底面颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 15:31