zoukankan      html  css  js  c++  java
  • iOS---TextView显示HTML文本

        _checkAllIntroduceTextView = [[UITextView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth-20, kScreenHeight)];

        _checkAllIntroduceTextView.backgroundColor = self.view.backgroundColor;

        _checkAllIntroduceTextView.returnKeyType=UIReturnKeyDone;

        _checkAllIntroduceTextView.delegate = self;

        _checkAllIntroduceTextView.showsVerticalScrollIndicator = NO;

        NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:[@"后台返回给你的html格式的字符串" dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];

        _checkAllIntroduceTextView.attributedText = attributedString;

        _checkAllIntroduceTextView.textColor = KColor_Gray_6;

        [self.view addSubview:_checkAllIntroduceTextView];

    <p><strong><span class="fontstyle0">U3010U8fceU777fU57faU91d1U3011</span></strong></p><p><span class="fontstyle0">U662fU4e00U5bb6U4ee5U6df1U5ea6U7814U7a76U3001 U4ef7U503cU6316U6398U4e3aU6838U5fc3Uff0cU7acbU8db3U4e8eU5168U7403U89c6U91ceUff0cU5177U6709U6df1U539aU4ea7U4e1aU80ccU666fU7684U4e13U4e1aU6295U8d44U516cU53f8Uff0cU516cU53f8U4e1aU52a1U8986U76d6U8d44U4ea7U7ba1U7406U7684U591aU4e2aU9886U57dfU3002<br />U516cU53f8U4f9dU6258U63a7U80a1U80a1U4e1cU6df1U539aU7684U4ea7U4e1aU53caU91d1U878dU80ccU666fU9ad8U901fU53d1U5c55Uff0cU4e8e2014U5e74U6b63U5f0fU6210U7acbUff0cU5e76U5df2U6210U4e3aU4e2dU56fdU8bc1U5238U6295U8d44U57faU91d1U4e1aU534fU4f1aU4f1aU5458U3002</span></p><ul style="list-style-type: disc;"><li><strong>U7acbU8db3U4e8eU5168U7403U89c6U91ce</strong></li></ul><p>U8fceU777fU57faU91d1U662fU4e00U5bb6U4ee5U6df1U5ea6U7814U7a76Uff0cU4ef7U503cU6316U6398U4e3aU6838U5fc3Uff0cU7acbU8db3U4e8eU5168U7403U89c6U91ceU5177U6709U6df1U539aU4ea7U4e1aU80ccU666fU7684U4e13U4e1aU6295U8d44U516cU53f8Uff0cU516cU53f8U4e1aU52a1U8986U76d6U8d44U4ea7U7ba1U7406U7684U591aU4e2aU9886U57dfU3002</p><ul style="list-style-type: disc;"><li><strong>U5b89U5168U7a33U5065U9ad8U901fU53d1U5c55</strong></li></ul><p>U516cU53f8U4f9dU6258U63a7U80a1U80a1U4e1cU6df1U539aU7684U4ea7U4e1aU53caU91d1U878dU80ccU666fU9ad8U901fU53d1U5c55Uff0cU4e8e2014U5e74U6b63U5f0fU6210U7acbUff0cU5e76U5df2U6210U4e3aU4e2dU56fdU8bc1U5238U6295U8d44U57faU91d1U4e1aU534fU4f1aU4f1aU5458U3002U6295U8d44U8005U8d44U91d1U5747U59d4U6258U94f6U884cU5168U7a0bU76d1U7ba1Uff0cU7ecfU4e25U683cU7684U98ceU9669U63a7U5236U4f53U7cfbU548cU624bU6bb5Uff0cU5145U5206U8fd0U7528U5e02U573aU6cd5U5219Uff0cU901aU8fc7U79d1U5b66U5316U7684U8d44U672cU8fd0U4f5cUff0cU786eU4fddU5ba2U6237U7684U8d44U672cU6295U8d44U5b89U5168U7a33U5065Uff0cU4ef7U503cU589eU503cUff0cU6548U76caU589eU957fUff0cU5145U5206U5b9eU73b0U793eU4f1aU6548U76caUff0cU7ecfU6d4eU6548U76caU4ee5U53caU793eU4f1aU8d44U672cU4e09U65b9U5171U8d62U7684U5706U6ee1U5c40U9762U3002</p><ul style="list-style-type: disc;"><li><strong>U7cbeU82f1U6c47U96c6U670dU52a1U4e13U4e1a</strong></li></ul><p>U8fceU777fU57faU91d1U76eeU524dU62e5U6709U4e00U6279U5728U8bc1U5238U6295U8d44Uff0cU80a1U6743U6295U8d44Uff0cU8d44U4ea7U7ba1U7406U7b49U591aU4e2aU9886U57dfU7684U8d44U6df1U4e13U4e1aU4ebaU58ebUff0cU5e76U4e0eU56fdU5185U5916U4f17U591aU77e5U540dU91d1U878dU673aU6784U5c55U5f00U79efU6781U5408U4f5cU3002U516cU53f8U79c9U627fU201cU552fU6709U4e13U4e1aUff0cU65b9U663eU4ef7U503cU201dU7684U7ecfU8425U7406U5ff5Uff0cU4e0dU65adU81f4U529bU4e8eU63d0U5347U4e13U4e1aU80fdU529bUff0cU6253U9020U4e00U6d41U56e2U961fUff0cU5f15U5bfcU793eU4f1aU8d44U672cU8fdbU5165U8bc1U5238U6295U8d44Uff0cU65b0U4e09U677fU5e02U573aUff0cU517bU8001U7efcU5408U4ea7U4e1aUff0cU6587U5316U4ea7U4e1aU4ee5U53caU4f18U8d28BTU9879U76eeU7b49U56fdU5bb6U57faU7840U8bbeU65bdU5efaU8bbeU9886U57dfUff0cU7aedU529bU4e3aU5ba2U6237U63d0U4f9bU4e13U4e1aU5b8cU5584U7684U91d1U878dU6295U8d44U670dU52a1U3002</p>

  • 相关阅读:
    store.js
    ## $.each() 与.each()的区别
    创建新的option
    js 一个程序运行的时间计算
    HTML5之FileReader的使用(转)
    js 队列
    js 栈(进制转换)
    原生js实现二级联动
    原生js实现三级联动
    工具安装-Mac 卸载python3
  • 原文地址:https://www.cnblogs.com/KiVen2015/p/5790535.html
Copyright © 2011-2022 走看看