0

I want to display local html file that has css too in UIWebView. I am able to do that using following code..

NSURL *baseUrl = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];

NSString *path = [[NSBundle mainBundle] pathForResource:@"info" ofType:@"html"];

NSString *htmlString = [NSString stringWithContentsOfFile:path];
[webView loadHTMLString:htmlString baseURL:baseUrl];

I am not able to get hover effects and my understanding is my be there is no hover kind of thing in a touch mobile,

Any ways my main issue is I had deleted my index.html from resources and then re added the updated one but not getting the updated one..

I don't know what happen the web view still loads the old html file. I tried to clean project too.

Second thing can I get css effects in iphone..?

Thanks..

2 Answers 2

1

As far as I know you can only achieve this result by using javascript-events like ontouchstart (or something).

Sign up to request clarification or add additional context in comments.

2 Comments

hello @Tim.. can you plz navigate me to any tutorial you are talking about.. Please.
I actually replied to your first question (hover-css), example (might contain some typos): ontouchstart='this.className="over";' and css: #obj.over {color: red;}.
0

I believe if you reset your simulator (While running your simulator, go to iOS Simulator > Reset Content and Settings in the menu bar) then re-run your app, the UIWebView will load the new index.html. UIWebViews cache these things, so you can add code to clear that cache and/or ignore the cache. Check here: Clearing UIWebview cache

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.