Created
September 22, 2010 08:30
-
-
Save samchandra/591363 to your computer and use it in GitHub Desktop.
Creating transparent UIWebView as UITableViewCell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating UITableView Cell | |
// Transparent UIWebView | |
CGRect cellFrame = CGRectMake(0, 0, 320, 100); | |
cell = [[[UITableViewCell alloc] initWithFrame:cellFrame] autorelease]; | |
CGRect labelFrame = CGRectMake(5,5,310,90); | |
UIWebView *textWebView = [[[UIWebView alloc] initWithFrame:labelFrame] autorelease]; | |
textWebView.backgroundColor = [UIColor clearColor]; | |
[textWebView setOpaque:NO]; | |
NSString *content = @"<html><body style=\"background-color: transparent; color:#FFFFFF\">There is damage that often hurts us more than the vehicle itself; small blemishes on the exterior and in the interior which simply cannot be avoided over the course of the vehicle's life. In many cases such damage can be fixed with very little fuss - and without replacing entire parts.</body></html>"; | |
[textWebView loadHTMLString:content baseURL:nil]; | |
[cell addSubview:textWebView]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment