UIView clearColor在IOS5 Xcode4.2中生成白色而不是透明
自从我用IOS 5更新Xcode之后,我面临着一个非常奇怪的问题。。。 我无法将UIView的背景色设置为透明 以下是我能做的: 我可以将视图设置为任何颜色,绿色、蓝色、红色,它们都在UIVIEW上正确显示UIView clearColor在IOS5 Xcode4.2中生成白色而不是透明,uiview,ios5,transparency,background-color,xcode4.2,Uiview,Ios5,Transparency,Background Color,Xcode4.2,自从我用IOS 5更新Xcode之后,我面临着一个非常奇怪的问题。。。 我无法将UIView的背景色设置为透明 以下是我能做的: 我可以将视图设置为任何颜色,绿色、蓝色、红色,它们都在UIVIEW上正确显示 [self.view setBackgroundColor:[UIColor greenColor]]; // Working 100 % 我可以设置背景图像//它也在工作 [self.view setBackgroundColor:[UIColor colorWit
[self.view setBackgroundColor:[UIColor greenColor]]; // Working 100 %
我可以设置背景图像//它也在工作
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"abc2010.png"]]]; // Working 100 %
[self.view setBackgroundColor:[UIColor clearColor]]; // No Error but result is not what I need
而不是透明的背景,它总是白色的
我将感谢你帮我解决这个问题!!:) 我也遇到了同样的问题。这里有几件事要做。 首先,确保将视图设置为不不透明:
[self.view setOpaque:NO];
第二,设置视图层,使其也为clearColor:
[self.view.layer setBackgroundColor:[UIColor clearColor]];
看看这是否有帮助。它解决了我的问题,你的声音和我的一样。
祝你好运