From ea9908e617fded9349739a4bb3d1f5289731b00a Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Thu, 11 Jan 2018 11:12:24 +0800 Subject: [PATCH] Fix message layout issue when sliding back controller --- CHANGELOG.md | 3 +++ Sources/Views/Cells/TextMessageCell.swift | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69b28b1..4176b57f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Fixed +- Fixed message rendering when `MessagesViewController` sliding back. +[#454](https://github.com/MessageKit/MessageKit/pull/454) by [@zhongwuzw](https://github.com/zhongwuzw). + - Fixed `iPhoneX` `MessageInputBar` transparent bottom area when `keyboardDismissMode` is `interactive`. [#425](https://github.com/MessageKit/MessageKit/pull/425) by [@zhongwuzw](https://github.com/zhongwuzw). diff --git a/Sources/Views/Cells/TextMessageCell.swift b/Sources/Views/Cells/TextMessageCell.swift index 0d792828..bd040ee4 100644 --- a/Sources/Views/Cells/TextMessageCell.swift +++ b/Sources/Views/Cells/TextMessageCell.swift @@ -45,6 +45,7 @@ open class TextMessageCell: MessageCollectionViewCell { if let attributes = layoutAttributes as? MessagesCollectionViewLayoutAttributes { messageLabel.textInsets = attributes.messageLabelInsets messageLabel.font = attributes.messageLabelFont + messageLabel.frame = messageContainerView.bounds } } @@ -57,11 +58,6 @@ open class TextMessageCell: MessageCollectionViewCell { open override func setupSubviews() { super.setupSubviews() messageContainerView.addSubview(messageLabel) - setupConstraints() - } - - open func setupConstraints() { - messageLabel.fillSuperview() } open override func configure(with message: MessageType, at indexPath: IndexPath, and messagesCollectionView: MessagesCollectionView) {