Browse Source

keep font size if initials badge dynamical, depending on size of the badge

cyberta 4 năm trước cách đây
mục cha
commit
e152d4862f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      DcCore/DcCore/Views/InitialsBadge.swift

+ 1 - 1
DcCore/DcCore/Views/InitialsBadge.swift

@@ -7,7 +7,6 @@ public class InitialsBadge: UIView {
 
     private var label: UILabel = {
         let label = UILabel()
-        label.font = UIFont.systemFont(ofSize: 26)
         label.textAlignment = NSTextAlignment.center
         label.textColor = UIColor.white
         label.translatesAutoresizingMaskIntoConstraints = false
@@ -62,6 +61,7 @@ public class InitialsBadge: UIView {
         translatesAutoresizingMaskIntoConstraints = false
         heightAnchor.constraint(equalToConstant: size).isActive = true
         widthAnchor.constraint(equalToConstant: size).isActive = true
+        label.font = UIFont.systemFont(ofSize: size * 3 / 5)
         setupSubviews(with: radius)
         isAccessibilityElement = true
     }