开发者

UIView that takes you to anchor link

开发者 https://www.devze.com 2022-12-12 08:27 出处:网络
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 t

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 anch开发者_JAVA技巧or link from the already loaded HTML content or I would have to reload the page with the anchor link in the URL?

thanks,

fbr


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 Programmatically scroll to an Anchor Tag on how to use the Javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消