You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is my code, and I don't know where I'm making a mistake.
I don't use frames, I need only height so I can set height autolayout constraint from code.
Actually after re-reading your code this is probably normal if your text only fit in one line (see maybe related #3) and your font has a lineHeight of 21, right?
I'm not sure using both sizeToFit and AutoLayout is compatible (this assertion is not related to OHAttributedLabel only, and is true for any UIView). AutoLayout is supposed to adapt the frame of your views by applying constraints. Calling sizeToFit also try to change this frame, but AutoLayout has always higher priority.
When you use AutoLayout, changing a view.frame with [UIView setFrame:] and such methods (which obviously sizeToFit does as stated in the Apple documentation) won't work (won't do anything), because AutoLayout will apply its constraints and change the frame back by itself afterwards.
According to my tests I'm guessing it's not an OHAttributedLabel issue but a problem understanding the way AutoLayout works and probably some inconsistency in your AutoLayout constraints.
Here is my code, and I don't know where I'm making a mistake.
I don't use frames, I need only height so I can set height autolayout constraint from code.
The text was updated successfully, but these errors were encountered: