我正在尝试在 UIView 中显示广告...我需要将背景颜色设置为透明...我尝试使用,
[viewObject setBackgroundColor:[UIColor clearcolor]];
尽管它使 UIView 透明,但它显示的是白色背景...
下面是我试过的HTML代码...
NSString *HTML = [NSString stringWithFormat:@"<html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no\"/><style>*{margin:0px;padding:0px}</style>
</head><body style=\" background-color:transparent\"><div style=\"text-align: %@\">%@</div></body></html>",adAlignment,link];
提前致谢...
问候,,
苏拉杰
最佳答案
您是否还在 View 上设置了opaque = NO;
?
关于iphone - 通过 HTML 代码在 UIView 中使用透明背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5076213/