用户登录
用户注册

分享至

UIWebView自适应高度

  • 作者: 任性小娘子
  • 来源: 51数据库
  • 2022-08-17
//webview自适应高度     delegate里面实现

- (void)webViewDidFinishLoad:(UIWebView *)webView

{

    NSString *height_str= [webViewstringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"];

    heightCell = [height_str intValue];

    webView.frame = CGRectMake(0,0,320,heightCell);

    NSLog(@"height: %@", [webViewstringByEvaluatingJavaScriptFromString: @"document.body.offsetHeight"]);

}  


//禁止web滑动

 jobRequestWeb.scrollView.bounces = NO;

//取消web右边滑动条

 jobRequestWeb.scrollView.showsVerticalScrollIndicator = NO;

软件
前端设计
程序设计
Java相关