Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS change height of a uitableview [duplicate]

I need to change dynamically the height of a uitableview inside my view.

I tried with this code inside the viewDidLoad:

self.theTable.rowHeight = 90;
self.theTable.contentSize = CGSizeMake(320,900); 

The first line works and the height is changed, but the second doesn't work!

How can I do this?

like image 430
ghiboz Avatar asked Jul 08 '11 19:07

ghiboz


1 Answers

You can try resetting the bounds like this:

CGRect bounds = [tableView bounds];
[tableView setBounds:CGRectMake(bounds.origin.x, 
                            bounds.origin.y, 
                            bounds.size.width, 
                            bounds.size.height + 20)];
like image 102
Oscar Gomez Avatar answered Nov 22 '22 21:11

Oscar Gomez