iPhone Quartz CAAnimation 中的背景
每当我使用石英动画时,动画的背景都是白色的。 我怎样才能将其更改为不同的颜色。 这是我用来制作动画的代码
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:superview cache:YES];
[superview addSubview:backview];
[defaultview removeFromSuperview];
[UIView commitAnimations];
Whenever I am using a quartz animation the background of the animation is white. How can I change this to be a different color. This is the code I am using to produce the animation
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:superview cache:YES];
[superview addSubview:backview];
[defaultview removeFromSuperview];
[UIView commitAnimations];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这些转换的背景颜色与应用程序的一个
UIWindow
对象(其主窗口)的背景颜色相同。您可以使用界面生成器在 nib 文件(通常称为
MainWindow.xib
)中设置此颜色。您还可以通过编程方式设置此设置,例如在应用程序委托对象的
applicationDidFinishLaunching:
方法中,通过如下方式设置:顺便说一句,您还可以使用以下方法将此“颜色”设置为图像:方法,例如
colorWithPatternImage:
,UIColor
的便捷构造函数之一。参考:之前关于翻转视图背景颜色的问题。
I think the background color for these transitions is the same as the background color of your app's one
UIWindow
object - its main window.You can set this color in the nib file, usually called
MainWindow.xib
, using interface builder.You can also set this programmatically, such as in the
applicationDidFinishLaunching:
method of your app delegate object, via something like this:By the way, you can also set this "color" to be an image using a method such as
colorWithPatternImage:
, one of the convenience constructors ofUIColor
.Reference: a previous question on the flipping views background color.
背景是指动画还是整个视图背景?
By background means animation or whole view background?