mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Chat: Bug Fix - Adjust text message position when username is hidden.
This commit is contained in:
parent
54bb3eff40
commit
4b33c93bdf
4 changed files with 78 additions and 0 deletions
|
@ -27,4 +27,26 @@
|
|||
self.userNameLabel.textColor = VECTOR_TEXT_BLACK_COLOR;
|
||||
}
|
||||
|
||||
- (void)render:(MXKCellData *)cellData
|
||||
{
|
||||
[super render:cellData];
|
||||
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
// Adjust the top constraint of the message text view (This constraint is restored at the end of cell use see [didEndDisplay]).
|
||||
self.msgTextViewTopConstraint.constant -= self.userNameLabel.frame.size.height;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didEndDisplay
|
||||
{
|
||||
// Restore the top constraint of the message text view if it has been modified during rendering
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
self.msgTextViewTopConstraint.constant += self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
[super didEndDisplay];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -34,10 +34,27 @@
|
|||
{
|
||||
[super render:cellData];
|
||||
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
// Adjust the top constraint of the message text view (This constraint is restored at the end of cell use see [didEndDisplay]).
|
||||
self.msgTextViewTopConstraint.constant -= self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
if (self.bubbleData)
|
||||
{
|
||||
self.paginationLabel.text = [[self.bubbleData.eventFormatter dateStringFromDate:self.bubbleData.date withTime:NO] uppercaseString];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didEndDisplay
|
||||
{
|
||||
// Restore the top constraint of the message text view if it has been modified during rendering
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
self.msgTextViewTopConstraint.constant += self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
[super didEndDisplay];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -28,4 +28,26 @@
|
|||
self.userNameLabel.textColor = VECTOR_TEXT_BLACK_COLOR;
|
||||
}
|
||||
|
||||
- (void)render:(MXKCellData *)cellData
|
||||
{
|
||||
[super render:cellData];
|
||||
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
// Adjust the top constraint of the message text view (This constraint is restored at the end of cell use see [didEndDisplay]).
|
||||
self.msgTextViewTopConstraint.constant -= self.userNameLabel.frame.size.height;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didEndDisplay
|
||||
{
|
||||
// Restore the top constraint of the message text view if it has been modified during rendering
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
self.msgTextViewTopConstraint.constant += self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
[super didEndDisplay];
|
||||
}
|
||||
|
||||
@end
|
|
@ -35,10 +35,27 @@
|
|||
{
|
||||
[super render:cellData];
|
||||
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
// Adjust the top constraint of the message text view (This constraint is restored at the end of cell use see [didEndDisplay]).
|
||||
self.msgTextViewTopConstraint.constant -= self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
if (self.bubbleData)
|
||||
{
|
||||
self.paginationLabel.text = [[self.bubbleData.eventFormatter dateStringFromDate:self.bubbleData.date withTime:NO] uppercaseString];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didEndDisplay
|
||||
{
|
||||
// Restore the top constraint of the message text view if it has been modified during rendering
|
||||
if (self.userNameLabel.isHidden)
|
||||
{
|
||||
self.msgTextViewTopConstraint.constant += self.userNameLabel.frame.size.height;
|
||||
}
|
||||
|
||||
[super didEndDisplay];
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in a new issue