I am using an OHAttributedLabel called demoLbl to display text with formatted areas. This shortcut is laid out using Interface Builder and connected to a property in my ViewController. After the attribitedText attribute is assigned to the label, I want all the text to appear on the label.
If I do not resize the label, then the text is cut off at the end of the label so that the rest of the text is missing.
If I use [demoLbl sizeToFit]; then the height of the mark is greater or less than the text (about 10 points, changing with the length of the text), thereby giving me empty areas at the bottom of my view (after scrolling) plus the width of the mark is increased by about 2 points.
If I calculate the height of the source text (NSString) before putting it in the NSAttributedString and adding it to the attribitedText property, then the calculated height is too small to set it as the height of the label.
Is there a way to hack or trick that can be applied so that the height of the inscription is adjusted to the height of the NSAttributedString?
PS: To be more specific, I wanted to add OHAttributedLabel as a tag, but this is not allowed to me yet.
source share