当前位置:编程学习 > wap >>

UITextView,UIWebView 直接显示html代码

////获取html到NSString

 NSURL *url = [NSURL URLWithString:@"http://www.xtox.net/product/detail.action?product.id=11"];

 NSString *strHtml = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];

   
////显示到UIWebView
    [self.m_web loadHTMLString:strHtml baseURL:nil];

   
/////显示到UITextView
    [self.m_TextView setContentToHTMLString:strHtml];

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,