iPhone - 翻转视图显示白色背景 [英] iPhone - flipping views shows a white background

查看:76
本文介绍了iPhone - 翻转视图显示白色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用翻转动画在我的viewcontroller中的两个视图之间进行动画处理。问题是在动画发生时背景显示白色空白背景。我想显示黑色背景。

I am using the flip animation to animate between two views in my viewcontroller. The problem is that the background shows a white blank background while the animation is taking place. I would like to show a black background.

我尝试在IB和代码中将主视图的背景颜色设置为黑色。但背景仍然是白色。

I tried setting the background color of the main view to black both in IB and code. But the background is still white.

有人可以帮助我。

谢谢。

添加代码

[self setContentView:[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]];
contentView.backgroundColor = [UIColor blackColor];
[contentView addSubview:toolbar];
[self setView:contentView];
[contentView release];

frontView = [[FrontView alloc] initWithFrame:viewFrame];
[frontView setViewController:self];
[self.view insertSubview:frontView belowSubview:toolbar];

//Initializing the back view here too
//on button click, executing normal flip code

即使在此之后我得到一个白色背景

Even after this I get a white background

推荐答案

我认为你的问题可能是UIWindow在动画期间显示。要解决此问题,请设置主窗口的背景颜色。您可以在代码或IB中执行此操作。

I think your issue might be that the UIWindow is shown during the animation. To fix this issue, set the background color of your main window. You can do this in code or in IB.

这篇关于iPhone - 翻转视图显示白色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆