Я использую autoLayout для моего customCell в xib, потому что я хочу иметь переменную высоту для строк на основе текста.UITableView отскакивает с оценкой RowHeight
Сейчас в моем VC.m
Я использую эти строки кода
- (void)viewdidLoad
{
m_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
m_tableView.estimatedRowHeight = 97.0;
m_tableView.rowHeight = UITableViewAutomaticDimension;
}
вот моя cellForRow функция
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CustomCell *tableCell = (NotesCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (tableCell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
tableCell = [nib objectAtIndex:0];
}
// Configure the cell...
//This code is used to make the separator full width. Also the tableview separator insets should be set to zero
tableCell.layoutMargins = UIEdgeInsetsZero;
tableCell.preservesSuperviewLayoutMargins = NO;
return tableCell;
}
Так что теперь, когда я обновляю строку я называю эти строки кода
[m_tableView beginUpdates];
[m_tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:m_indexPath] withRowAnimation:UITableViewRowAnimationFade];
[m_tableView endUpdates];
Когда я это делаю, Tableview просто отскакивает. Я не знаю, что происходит не так
С уважением Ранджит
Любые удачи на этом? –