views:

61

answers:

2

I have an app with a UITableView and a corresponding detail view for each row. In the detail view I have to display some text and a background image (text is different for each row, but the image remains the same). The easiest way, in my opinion, is to put the text in an .rtf file and display it in a UIWebView. Then just put a UIImageView behind the UIWebView.

I've tried to set the UIwebView's opacity to zero in IB, but i didn't help.

Can you help me?

Thanks in advance!

+1  A: 

[webView setDrawsBackground:NO] should be enough

Nava Carmon
Thank you! It worked!
Knodel
A: 

Nava's solution crashes with an unrecognized selector exception. In fact, setDrawsBackground is not mentioned anywhere in the iOS SDK (perhaps this is available on the Mac?).

Instead, I recommend:

webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];

(for some reason it didn't work to set those properties via IB) and include this into your HTML code:

<body style="background-color: transparent;">
Ortwin Gentz