ios - iPhone / Three20: Adding a dynamic list of labels to a tablecell as a subview -
i'm writing iphone app using three20
framework , i'm struggling figure out how can add dynamic list of uilabel
s table cell.
i've attempted subclass tttabletextitem
, tttabletextitemcell
in order display dynamic list, i'm having hard time trying write layoutsubviews
, setobject
, initwithstyle
methods.
i've read subclassing here , here , whilst can replicate these simple examples table cells have static number of controls, i've still not had luck attempting recreate number of controls dynamic based on data passed table cell.
the data i'm pulling list of employee
s, , each employee has nsarray
of 1 or more job
s (so cell height needs dynamic, list of labels represent jobs).
each job
has name, , colour associated it.
my intention create cells similar following:
cell one
- "employee one"
- "job-1 colour label" "job-1 name label"
- "job-2 colour label" "job-2 name label"
- ....
- "job-n colour label" "job-n name"
cell two
- "employee two"
- "job-1 colour label" "job-1 name label"
- "job-2 colour label" "job-2 name label"
- ....
- "job-n colour label" "job-n name"
if point me in right direction, that'd appreciated!
from can tell, there isn't easy way i'm after here. @tonklon's suggestion of changing design best option here , did.
Comments
Post a Comment