I need to add a long string to a UiTextView/UiLabel or any UI Element. Parts of this string are of different colors. Also, i need to find out what will be the height of this element after setting this attributed string on it, given i hcan work out a fixed width. I know i can use boundingRectWithSize:, but how do i create dictionary, as there are more than one NSForegroundColorAttributeName values. Please help. Thanks in advance.
Asked
Active
Viewed 173 times
1
-
Please refer link...http://stackoverflow.com/questions/3642540/uitextview-with-syntax-highlighting – Ashok Londhe Apr 27 '15 at 11:42
-
It does not talk about dynamic height calculation. – Avi Apr 27 '15 at 16:04
-
I don't understand why changing colore(`NSForeGroundColorAttributeName`) should change the size of the rendered text. – Larme Apr 27 '15 at 16:40
-
If it does not, then how to calculate the dynamic height for appended product of different attributed texts with different colors and fonts. – Avi Apr 27 '15 at 19:57
-
This link is for multicolour textview text... – Ashok Londhe Apr 28 '15 at 04:33