Can I have UILabel truncate text similar functionality on UIWebview?
So I want to truncate the text on tail, for example
abcdefghijklmnopqrstuvwxyz1234567890
becomes
abcdefghijkl...
My UIWebview will only have one line.
It could be done by adding some CSS to the web content (for example this CSS from Truncate String with Ellipsis).
.truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Otherwise, why not use a UILabel
with an NSAttributedString
?