Edit: I fixed my problem, but I would be interested to understand why my fix works. See below.
I am using autolayout to build my UITableViewCell s.
The cell is pretty simple with two labels (purple and yellow) and a text box (green).

This works great when displaying for the first time. But when I click on the new view controller, the view instantly rebuilds. The purple label is getting bigger for any reason.
Here is an example when I click on the “Parent Account ID” cell to click on the new view controller. Please note that as soon as the transition begins, the layout will change. When I return, he is still changed.

Elements are created using [UILabel new] without a frame.
[self.contentView addSubview:self.textLabel]; [self.contentView addSubview:self.errorLabel]; [self.contentView addSubview:self.textField];
Then autorun is created using Masonry .
UIEdgeInsets insets = UIEdgeInsetsMake(3, 15, 3, 15); [self.textLabel makeConstraints:^(MASConstraintMaker *make) { make.left.top.equalTo(self.contentView).insets(insets); make.width.priorityLow(); }]; [self.errorLabel makeConstraints:^(MASConstraintMaker *make) { make.top.right.equalTo(self.contentView).insets(insets); make.left.equalTo(self.textLabel.right).offset(5); }]; [self.textField makeConstraints:^(MASConstraintMaker *make) { make.left.bottom.right.equalTo(self.contentView).insets(insets); make.top.equalTo(self.textLabel.bottom).insets(insets); }];
Notice that I never indicate height because I don't care about height. (as long as it is consistent!)
Any idea why this might change? Thanks
Edit: I found a fix.
Now I also set the contentView auto-detection contentView .
[self.contentView makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self); }]
I'm still curious to understand why the contentView !