Reputation: 677
I have a UINavigationController
that contains the view of a UITableViewController
. How can I resize the table view from within the navigation controller?
Upvotes: 1
Views: 2494
Reputation: 7921
[[self tableView] setFrame:CGRectMake(0, 0, 320, 480)];
Upvotes: 1
Reputation: 999
Maybe this method will help you to resize the table rows:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
Upvotes: -1
Reputation: 5940
Not exactly sure if this is what you are looking for but its sounds close enough. This will resize your tableView to whatever pixel size you specify. It will do it in a transition too (so it doesnt just jump to size). You can remove the transition if you wanted.
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
CGRect rect = myTableView.frame;
rect.size.height = 400;
rect.size.width = 300;
myTableView.frame = rect;
[UIView commitAnimations];
Upvotes: 2