Re: [iPhone] Make UIWebView content empty before loading next page
Re: [iPhone] Make UIWebView content empty before loading next page
- Subject: Re: [iPhone] Make UIWebView content empty before loading next page
- From: Bruce Turner <email@hidden>
- Date: Fri, 19 Nov 2010 20:21:09 -0500
On Nov 19, 2010, at 3:02 PM, email@hidden wrote:
On Fri, 19 Nov 2010 14:49:11 +0530, Tharindu Madushanka <email@hidden
> said:
Hi,
I would like to make UIWebView content empty while other page is
loading. I
tried loading [webview loadRequest:nil];
And also [webview loadHtmlString:@"<html></html>" baseUrl:nil];
Just before my [webview loadRequest:request]; method call.
Still I am having previous html page shown a very little time until
next
page is show. I load content for a button click.. so when I click
the button
my webview still has old content for a very small time.
How could I get rid of that.. can somebody kindly point some way..
I have not tried this myself, but keeping in mind that views are not
redrawn until after your code finished running, I'd suggest trying
delayed performance to give the view a chance to empty itself before
doing the load request. m.
Something that I have used to clear a UIWebView when reopening with
previous content is to execute the following command:
[webView
stringByEvaluatingJavaScriptFromString
:@"document.open();document.close()"];
This resulted in a blank view. Haven't tried it recently, so I don't
know if there are any problems with current versions.
Bruce Turner
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden