zoukankan      html  css  js  c++  java
  • uiwebview 加载html时字体变小 加载前或加载后改变字体大小

     

    为加载时添加代码  30设置的字体大小  strings HTML代码 注意:如果设置了style必须把font去掉,不然没效果 有table也没效果

     margin 距离边界距离 

      适合自适应高度

     NSString *string = [NSString stringWithFormat:@"<html> "

         "<head> "

         "<style type="text/css"> "

         "body {margin:10;font-size: %d;} "

         "</style> "

         "</head> "

         "<body>%@</body> "

         "</html>",30,strings];

     

     //加载后改变webview字体大小

     

        [self.web stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '300%'"];

       成比例缩放字体

  • 相关阅读:
    【bzoj3676】[Apio2014]回文串 —— 回文自动机的学习
    树链剖分求LCA
    读入输出优化
    【bzoj3124】[Sdoi2013]直径
    【codevs2183】匹配字符串
    【codevs2011】【LNOI2013】最小距离之和
    【codevs1306】广播操的游戏
    【hdu3966】Aragorn's Story
    【hdu3518】Boring counting
    C++-HDU3400-Line belt[三分]
  • 原文地址:https://www.cnblogs.com/wujie123/p/6117685.html
Copyright © 2011-2022 走看看