fix ContactDetailsView

This commit is contained in:
Danmei Chen 2019-01-03 15:13:27 +01:00
parent dadfaebf07
commit e2ab43b007

View file

@ -247,6 +247,8 @@
}
_cancelButton.hidden = TRUE;
}
[self recomputeTableViewSize:_editButton.hidden];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -360,23 +362,25 @@ static UICompositeViewDescription *compositeDescription = nil;
_nameLabel.hidden = editing;
[ContactDisplay setDisplayNameLabel:_nameLabel forContact:_contact];
if ([self viewIsCurrentlyPortrait]) {
CGRect frame = _tableController.tableView.frame;
frame.origin.y = _avatarImage.frame.size.height + _avatarImage.frame.origin.y;
if (!editing) {
frame.origin.y += _nameLabel.frame.size.height;
}
frame.size.height = _tableController.tableView.contentSize.height;
_tableController.tableView.frame = frame;
[self recomputeContentViewSize];
}
[self recomputeTableViewSize:editing];
if (animated) {
[UIView commitAnimations];
}
}
- (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.size.height = _tableController.tableView.contentSize.height;
_tableController.tableView.frame = frame;
[self recomputeContentViewSize];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change