PDA

View Full Version : How do I resize table to fit contents?




mrl72
Jan 9, 2011, 04:11 PM
I have a UITableView sitting on a view that has cells and rows dynamically created. Since I have a custom background on the view I want the table to automatically resize to fit the content. So for example if I only have 5 rows that take up 1/4 of the screen right now my table is stretching to the bottom of the screen, I really want it to stop after the last row in the table.

I have tried UIViewAutoresizingFlexibleHeight but that didn't seem to do anything.

Cheers.