views:

126

answers:

1

I'm developing an iPhone app where I have my HTML content loaded in a UIWebview as a HTMLString and would like to have a UIView that tells the UIWebview to scroll to an anchor link. Can I scroll to the anchor link from the already loaded HTML content or I would have to reload the page with the anchor link in the URL?

thanks,

fbr

+2  A: 

This is a complete guess, but perhaps you could make the UIWebView scroll with Javascript?

You can execute Javascript in your UIWebView with this method

- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script

See http://stackoverflow.com/questions/265774/programmatically-scroll-to-an-anchor-tag on how to use the Javascript.

nduplessis