I am experiencing a problem where in my UITableViewController, the last row is always cutoff by half.
If I have 20 rows, the 20th will be cut off; if I have 30, the 30th will be cut off.
I tried to resize the contentSize, and the frame of the UITableViewController, but it doesn’t work.
Is there a way to resize the UITableViewController to the correct size?
Thanks in advance.
Some Code:
Initialize it in another class:
settingsTable = [[SettingTableViewController alloc] init];
settingsTable.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:settingsTable.view];
in the UITableViewController:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return [settingsData count];
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [[settingsData objectForKey:[NSString stringWithFormat:@"%d", section]] objectAtIndex:0];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [[[settingsData objectForKey:[NSString stringWithFormat:@"%d", section]] objectAtIndex:1] intValue];
}
I didn’t resize the frame anywhere in the UITableViewController
In the interface builder, select the
UITableViewand then under the View options remove the bottom autoresizing bar. You can leave all the others the way they are if they are different from the screenshots below. The important one is the bottom vertical bar.Change this:
To this:
Or, to do it programmatically:
Edit (from comments):
Is your status bar set to showing or hidden? If it is showing then change the frame line to:
Or, try either one of these and see if they help: