开发者

Underside color of curling view using UIViewAnimationTransitionCurlUp

Can one customize the underside color of curling view in a UIViewAnimationTransitionCurlUp animation. The default 开发者_如何学Goseems to be gray/white but i needed a different one.


Officially, no.


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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜