Reputation: 3629
I have an attributed string with "Date: Heading - Description."
The Date, Heading, and Description text values are dynamically generated, and all have different attributed fonts which I've assigned to the appropriate substring.
How should I determine the total width, and then consequentially the determine the height for a given width which this content should fill?
I've found this SO post but it is from 2010 and a more current solution seems like it would be available.
Additionally, how should the width of an attributed string with content changing text style by substring be determined? The iOS7 sizeWithAttributes method seems to apply the attributes for the entire string.
Upvotes: 0
Views: 158
Reputation: 534885
This is an attributed string, so the place to look is the NSAttributedString documentation. In particular:
As to your last paragraph: simply make this a mutable attributed string, change the styles as desired, and proceed as above.
Upvotes: 1