I’m currently trying to implement a feature in my app that shows tags for a post. I want it to work very similar to that of tags here on StackOverflow, in that they have a colored background.
Another example, are the Inline Labels here.
I’m just not quite sure on how to get it implemented. My first guess would to create an array of UILabels… Any suggestions?
Figure out what you want the tags to look like. If you can achieve that appearance with existing components like labels or tokens, then great, problem solved. If not, creating your own UIView subclass that draws a background and bit of text is pretty simple — you wouldn’t need to write much more code than a custom
-drawRect:method, and even that should be easy. For example, if you wanted something that looks like the Twitter-ish inline labels, you could start with a resizable image and then draw your text on top.Don’t be afraid to create your own view classes… it’s fun!