From d29e46ba60379cae9e357dfb60ad76255377ef39 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Thu, 23 Jun 2022 11:23:44 +0200 Subject: [PATCH] Fix bug that could cause a clipping/hiding of a contact name depending on the phone orientation --- Classes/ContactDetailsView.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Classes/ContactDetailsView.m b/Classes/ContactDetailsView.m index 3c3e397d9..8e423b2b1 100644 --- a/Classes/ContactDetailsView.m +++ b/Classes/ContactDetailsView.m @@ -296,6 +296,7 @@ [_editButton setImage:[UIImage imageNamed:@"valid_default.png"] forState:UIControlStateSelected]; [self updateBackOrCancelButton]; + [self recomputeTableViewSize:FALSE]; } - (void)deviceOrientationDidChange:(NSNotification*)notif { @@ -312,7 +313,8 @@ [self updateBackOrCancelButton]; - [self recomputeTableViewSize:_editButton.hidden]; + BOOL isEditing = !self.contact.createdFromLdap && _editButton.hidden; + [self recomputeTableViewSize:isEditing]; } - (void)viewWillDisappear:(BOOL)animated { @@ -408,10 +410,11 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)recomputeTableViewSize:(BOOL)editing { CGRect frame = _tableController.tableView.frame; - frame.origin.y = _avatarImage.frame.size.height + _avatarImage.frame.origin.y; if ([self viewIsCurrentlyPortrait] && !editing) { - frame.origin.y += _nameLabel.frame.size.height; - } + frame.origin.y = _nameLabel.frame.origin.y + _nameLabel.frame.size.height; + } else { + frame.origin.y = _avatarImage.frame.size.height + _avatarImage.frame.origin.y; + } frame.size.height = _tableController.tableView.contentSize.height; _tableController.tableView.frame = frame;