Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 08-04-2011, 03:58 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 11
alpopek is on a distinguished road
Default UIWebView issue - no css on first load

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?
alpopek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 382
17 members and 365 guests
Absentia, bignoggins, Diligent, dre, givensur, hussain1982, jbro, jPuzzle, LunarMoon, momolgtm, Newbie123, Paul10, pinacate, revg, skog, taylor202
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,643
Threads: 94,110
Posts: 402,858
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Diligent
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:46 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0