Parcourir la source

Merge pull request #1239 from deltachat/fix_status_font

ensure MultilineLabelCell immediately reacts on font scaling
bjoern il y a 4 ans
Parent
commit
a44bc8c1ed
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      deltachat-ios/View/MultilineLabelCell.swift

+ 7 - 0
deltachat-ios/View/MultilineLabelCell.swift

@@ -60,6 +60,13 @@ class MultilineLabelCell: UITableViewCell {
             logger.info("status: tapped outside urls or phone numbers")
         }
     }
+
+    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        if previousTraitCollection?.preferredContentSizeCategory !=
+            traitCollection.preferredContentSizeCategory {
+            label.font = UIFont.preferredFont(for: .body, weight: .regular)
+        }
+    }
 }
 
 extension MultilineLabelCell: MessageLabelDelegate {