How to Multiple Colors in String?
I have a table row view with a header and a couple of table rows.
How do I vary the color of the text within the strings without using a WebViewController?
If I need rich text, can I use the table row view for say the first three levels and then the WebViewController for the last level in the tree?
Lets say the bottom layer has the following:
Header - Best books
Table Row 1 - Best books for travel in America.
Table Row 2 - Best books for travel in Europe.
Table Row 3 - Best books for cooking.
So in this example, I would like the text in the table rows to be marked up as follows:
Table Row 1 - Best books for travel in America.
Table Row 2 - Best books for travel in Europe.
Table Row 3 - Best books for cooking.
So to make the table row information quicker to scan I have done the following:
Made Best books lighter in color since the exact words are already stated in the header.
Made America, Europe & cooking in Orange since these are the words that are different in each sentence. This way the user can quickly see which table row they would like to select.
The data is being pulled from CoreData and is working right now except for not being able to figure out how to make different parts of the string different colors based on a comparison between two or three table rows and the section header.
Any ideas as to direction? I can write the code but just don't know where to start? Ideas would be greatly appreciated!
Last edited by aharding; 03-04-2010 at 10:35 PM.
Reason: Colors didn't take
|