UIView的clearColor在IOS5 Xcode4.2中产生WhiteColor而不是Transparent
自从我用 IOS 5 更新 Xcode 以来,我遇到了一个非常奇怪的问题...... 我无法将 UIView 的背景颜色设置为透明...
这是我能做的:!!
我可以将视图设置为任何颜色,绿色,蓝色,红色,它们都在 UIVIEW 上正确显示
[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
而不是透明背景,它始终是白色...!
我将不胜感激帮助解决问题! :)
I am facing a very strange issue ever since I updated the Xcode with IOS 5 ...
I can't able to set the background Color of UIView to Transparent ...
here is What I can do :!!
I can set the view to any color , green , blue , red and they are all shown correctly on UIVIEW
[self.view setBackgroundColor:[UIColor greenColor]]; // Working 100 %
I can set a background Image // it's Working too
[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
instead of transparent Background , it is always WHITE ... !!
I'll appreciate the help in figuring out the problem!! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚遇到了同样的问题。这里有几件事要做。
首先,确保设置视图,使其不是不透明的:
其次,设置视图图层,使其也是清晰的颜色:
看看是否有帮助。它解决了我的问题,你的听起来和我的一样。
祝你好运。
I've just had this same problem. Here's a couple things to do.
Firstly, make sure you set the view so it's not opaque:
Second, set the views layer so it's also clearColor:
See if that helps. It fixed my problem, and your's sounds just like mine.
Good luck.