UITableView bounces with RowHeight rating

I use autoLayout for my customCell in xib because I want to have a variable height for text based strings.

Now in my VC.m

I use these lines of code

- (void)viewdidLoad
{
    m_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];       
    m_tableView.estimatedRowHeight = 97.0;
   m_tableView.rowHeight = UITableViewAutomaticDimension;
}

here is my cellForRow function

- (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;
}

So, whenever I update a line, I call these lines of code

[m_tableView beginUpdates];
    [m_tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:m_indexPath] withRowAnimation:UITableViewRowAnimationFade];
    [m_tableView endUpdates];

When I do this, Tableview just bounces. I do not know what is going wrong.

Ranjit Relations

+4
source share
3 answers

, , . , , , , , , , .

, - , tableView:estimatedHeightForRowAtIndexPath: , , .

+1

dequeueReusableCellWithIdentifier:forIndexPath, , .

, , - , . , xcode 6 - .

, , , , , traitCollection .

0

All Articles