I need to display some simple formatted text inside a small section of a View. The background needs to be transparent because there's a background gradient image.
How I should I go about this? Maybe the Web View control will do the trick? thanks
I need to display some simple formatted text inside a small section of a View. The background needs to be transparent because there's a background gradient image.
How I should I go about this? Maybe the Web View control will do the trick? thanks
An UIWebView with a transparent background should do the trick, indeed. You could use something like:
UIWebView *formattedText = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 200, 50)]; [formattedText loadHTMLString:@"My <strong>formatted</strong> text" baseURL:nil];
Be careful though: UIWebViews are heavy objects that suck a lot of memory, plus they may take some time to load and render your text. You should release your label as soon as you don't need it anymore.