I am attempting to use a UILabel
that can show rich content. For this I use the attributedText
property in UILabel
and a NSAttributedString
I alloc with NSHTMLTextDocumentType
.
One type of formatting I want to achieve is to draw a border around paragraphs (for quotes). Normal text formatting like font, bold, italic etc seems to work fine, but when I use CSS properties like border it does not work as I would expect. See picture; only the background-color
property is shown.
The attributedText
property of this UILabel is:
<style>
body{font:10pt Verdana;} .quote {background-color:#ddd;border:1px solid #aaa;}
</style>
<body>
<div class="quote">This is a quote</div>
<br/>
Bla bla bla
</body>
What I expect is a border around the first sentence/paragraph, within the UILabel - not a border around the entire UILabel.
The text background shows, but the expected border does not. Is it even possible to achieve this? I'd prefer to use UILabel
to keep my UITableView
speedy.