`
lizhuang
  • 浏览: 888446 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

UIWebView滚动到底部的代码

 
阅读更多
实现UIWebViewDelegate中的

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    NSInteger height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"] intValue];
    NSString* javascript = [NSString stringWithFormat:@"window.scrollBy(0, %d);", height];  
    [webView stringByEvaluatingJavaScriptFromString:javascript];
}

原文地址:
http://stackoverflow.com/questions/3594851/how-can-i-scroll-programmatically-to-the-bottom-in-a-uiwebview
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics