PDA

View Full Version : Horizontal Scroll in TableViewCell




erosenba
Aug 26, 2009, 05:27 PM
Hi,

I'm creating an app where I will be displaying data in a tableview. I need to be able to show a variable amount of data which is stored in a mutable array (I was thinking in the forms of labels) and have it all in one cell. The table itself also needs to scroll vertically. I currently am loading the cells from a nib file but I can change that if need be. Any suggestions on how to implement some kind of horizontal scrolling or how to display the data would be really appreciated.

Thanks,
Erin



dejo
Aug 26, 2009, 05:32 PM
Any suggestions on how to implement some kind of horizontal scrolling or how to display the data would be really appreciated.
I would go with multi-line labels and then adjust the height of each row based on its content.

erosenba
Aug 26, 2009, 07:05 PM
UPDATE: I figured it out. Just add the UIScrollView to the cell in IB with a tag. In the cellForRowAtIndexPath method access the scrollview through the viewWithTag method and then set the contentsize and add any subviews you'd like.