Hi
I have a very weird issue with UIWebView.
I use this code to show webview content:
Code:
UIWebView* webView = [[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 300)] autorelease];
webView.opaque = NO;
[webView setBackgroundColor:[UIColor clearColor]];
NSData *data = [htmlString dataUsingEncoding:NSUTF8StringEncoding];
[webView loadData:data MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
The head of my htmlString is:
Code:
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<link rel="stylesheet" media="screen" type="text/css" href="style.css">
</head>
The problem is that when i launch my application for the first time it shows html body but without style from css.
Then when i quit app and run it once again, html body is well styled with css from header..
And after that it's always OK.
Maybe it's about some cache i don't know..
Could someone help me with this?