如何在NSAttributedString中使用CSS

时间:2014-02-24 18:39:15

标签: iphone ios7 uitextview nsattributedstring

我有html文件,我通过下面的代码加载

NSURL *htmlString = [[NSBundle mainBundle]URLForResource: @"index2" withExtension:@"html"];
NSAttributedString *stringWithHTMLAttributes = [[NSAttributedString alloc]   initWithFileURL:htmlString options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType} documentAttributes:nil error:nil];
UITextView *textView1 = [[UITextView alloc] initWithFrame:CGRectMake(20,20,self.view.frame.size.width,self.view.frame.size.height)];
textView1.attributedText=stringWithHTMLAttributes;

这里的问题是textview没有加载css文件, NSAttributedString字符串是否支持CSS? 如果是,请帮助我如何做到

提前谢谢:)

0 个答案:

没有答案