Browse Source

adaptive font sizes in chat view

cyberta 4 năm trước cách đây
mục cha
commit
dd8bdcf873

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

@@ -157,7 +157,7 @@ public class BaseMessageCell: UITableViewCell {
 
     func getFormattedBottomLine(message: DcMsg) -> NSAttributedString {
         var timestampAttributes: [NSAttributedString.Key: Any] = [
-            .font: UIFont.systemFont(ofSize: 12),
+            .font: UIFont.preferredFont(for: .caption1, weight: .regular),
             .foregroundColor: DcColors.grayDateColor,
             .paragraphStyle: NSParagraphStyle()
         ]

+ 1 - 0
deltachat-ios/Chat/Views/Cells/NewAudioMessageCell.swift

@@ -22,6 +22,7 @@ public class NewAudioMessageCell: BaseMessageCell {
         label.translatesAutoresizingMaskIntoConstraints = false
         label.numberOfLines = 0
         label.lineBreakMode = .byWordWrapping
+        label.font = UIFont.preferredFont(for: .body, weight: .regular)
         return label
     }()
 

+ 1 - 0
deltachat-ios/Chat/Views/Cells/NewFileTextCell.swift

@@ -76,6 +76,7 @@ class NewFileTextCell: BaseMessageCell {
         label.numberOfLines = 0
         label.lineBreakMode = .byWordWrapping
         label.setContentHuggingPriority(.defaultLow, for: .vertical)
+        label.font = UIFont.preferredFont(for: .body, weight: .regular)
         return label
     }()
 

+ 1 - 0
deltachat-ios/Chat/Views/Cells/NewImageTextCell.swift

@@ -14,6 +14,7 @@ class NewImageTextCell: BaseMessageCell {
         label.numberOfLines = 0
         label.lineBreakMode = .byWordWrapping
         label.setContentHuggingPriority(.defaultLow, for: .vertical)
+        label.font = UIFont.preferredFont(for: .body, weight: .regular)
         return label
     }()
 

+ 1 - 0
deltachat-ios/Chat/Views/Cells/NewTextMessageCell.swift

@@ -9,6 +9,7 @@ class NewTextMessageCell: BaseMessageCell {
         label.translatesAutoresizingMaskIntoConstraints = false
         label.numberOfLines = 0
         label.lineBreakMode = .byWordWrapping
+        label.font = UIFont.preferredFont(for: .body, weight: .regular)
         return label
     }()