Reputation: 408
I want to vertical-aling my text in UIWebview
:
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body> <div style=\"margin: 0 auto; text-align: center; height: 7em; line-height: 7em;background-color: %@; font-size: 25px; color:white\">%@</div></body></html>", myColor, string];
[self.webView loadHTMLString:htmlString baseURL:nil];
It vertical align, but it have a white border. I don't know what it is.
Upvotes: 0
Views: 597
Reputation: 1340
Try this...
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body style=\"width:100%%; margin:0px\"> <div style=\"margin:0 auto; width:100%%; text-align: center; height: 7em; line-height: 7em;background-color: %@; font-size: 25px; color:white\">%@</div></body></html>", @"#111111", @"Hello World...!!!"];
[webView loadHTMLString:htmlString baseURL:nil];
Upvotes: 1