zoukankan      html  css  js  c++  java
  • iOS 对H5加载html的数据的一些基础设置

    NSString *title = [NSString stringWithFormat:@"<p><font color="black" size="4"><strong>%@</strong></font> </p>",_webTitle]; //设置webView 标题打大小和颜色 以及加粗

    NSString *title = [NSString stringWithFormat:@"<p><font color="black" size="3">%@</font> </p>",_webTitle];  //设置webView 标题打大小和颜色

    NSString *dataa = [NSString  stringWithFormat:@"<style>img{max-320px}</style>%@",data];   //让h5 图片宽度 = 320

     NSString *time = [NSString stringWithFormat:@"<p><font color="gray" size="2">%@</font> </p>",_time];

     如果后台返回的是html的数据  不是url 

     NSString  *filePath = [NSString stringWithFormat:@"%@ %@ %@",title,time,dataa];

        

        financeWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0,0, kUIScreenWidth, kUIScreenHeight-64)];

        financeWeb.delegate = self;

        [financeWeb.scrollView setBounces:YES];

        financeWeb.backgroundColor = [UIColor whiteColor];

        [self.view addSubview:financeWeb];

        [financeWeb loadHTMLString:filePath baseURL:nil];

  • 相关阅读:
    阿狸的打字机(bzoj 2434)
    Censoring(bzoj 3940)
    文本生成器(bzoj 1030)
    病毒(bzoj 2938)
    Road(bzoj 2750)
    codevs 2370 小机房的树
    HDU 2838 Cow Sorting
    luogu P2253 好一个一中腰鼓!
    hdu 1166 敌兵布阵
    luogu P1901 发射站
  • 原文地址:https://www.cnblogs.com/Lovexiaohuzi/p/6688745.html
Copyright © 2011-2022 走看看