如何在Xcode中的UITextView中将html代码更改为普通文本?
顺便说一下,我在网站的Feed中加载了html。
我有html代码:
<p>
TestLocatie-1, Lelystad Adres: <adres>, <postcode> <plaatsnaam> Oppervlakte: <opp> m² Bestemming: <omschrijving bestemming, omschrijving bestemming> Omschrijving: <Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ulliam corper suscipit lobortis nisl ut aliquip ex ea commodo […]
</p>
<p>
The post <a rel="nofollow" href="http://www.flexstorez.nl/testlocatie-1/">TestLocatie-1</a> appeared first on <a rel="nofollow" href="http://www.flexstorez.nl">FlexStorez</a>.
</p>
答案 0 :(得分:0)
您可以使用此代码执行此操作。有些人说苹果会拒绝你的应用,如果你使用它,但有些人,苹果接受代码。
self.textview.editable = NO;
self.textview.dataDetectorTypes = UIDataDetectorTypeAll;
[self.textview setValue: yourHTMLString forKey:@"contentToHTMLString"];