Table View Cells jump when selected on iOS 8

前端 未结 5 882
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 06:36

I\'m trying to update my apps for iOS 8 and one strange issue that I can\'t figure out is that whenever I press a table view cell (on a grouped table view) and push another

5条回答
  •  清歌不尽
    2020-12-15 06:45

    You can achieve self-sizing with this code:

    implement together:
    tableView.rowHeight = UITableViewAutomaticDimension; 
    tableView.estimatedRowHeight = CGFloatValue (initial estimated height);
    

    in your storyboard, add the correct constraint on you cells.

    Note: the jump issue will still show sometimes.

    the exact solution for this jump issue is implementing the delegate method:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return CGFloat;
    
    }
    

提交回复
热议问题