瀏覽代碼

fix avatar view shown wrongly on recycled views

cyberta 4 年之前
父節點
當前提交
0b49807e18
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

+ 3 - 1
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -135,7 +135,10 @@ public class BaseMessageCell: UITableViewCell {
             if let profileImage = msg.fromContact.profileImage {
             if let profileImage = msg.fromContact.profileImage {
                 avatarView.setImage(profileImage)
                 avatarView.setImage(profileImage)
             }
             }
+        } else {
+            avatarView.isHidden = true
         }
         }
+
         messageBackgroundContainer.update(rectCorners: messageStyle,
         messageBackgroundContainer.update(rectCorners: messageStyle,
                                           color: msg.isFromCurrentSender ? DcColors.messagePrimaryColor : DcColors.messageSecondaryColor)
                                           color: msg.isFromCurrentSender ? DcColors.messagePrimaryColor : DcColors.messageSecondaryColor)
 
 
@@ -222,7 +225,6 @@ public class BaseMessageCell: UITableViewCell {
         topLabel.text = nil
         topLabel.text = nil
         topLabel.attributedText = nil
         topLabel.attributedText = nil
         avatarView.reset()
         avatarView.reset()
-        avatarView.isHidden = true
         messageBackgroundContainer.prepareForReuse()
         messageBackgroundContainer.prepareForReuse()
         bottomLabel.text = nil
         bottomLabel.text = nil
         bottomLabel.attributedText = nil
         bottomLabel.attributedText = nil