From 116e9c143ca2863aa4cedfdfd16c778b83771761 Mon Sep 17 00:00:00 2001 From: CMK Date: Wed, 30 Mar 2022 15:23:59 +0800 Subject: [PATCH] chore: fix the username text field right label too long in sign-up form --- .../Register/Cell/MastodonRegisterTextFieldTableViewCell.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mastodon/Scene/Onboarding/Register/Cell/MastodonRegisterTextFieldTableViewCell.swift b/Mastodon/Scene/Onboarding/Register/Cell/MastodonRegisterTextFieldTableViewCell.swift index 3daa2eb1..15f23483 100644 --- a/Mastodon/Scene/Onboarding/Register/Cell/MastodonRegisterTextFieldTableViewCell.swift +++ b/Mastodon/Scene/Onboarding/Register/Cell/MastodonRegisterTextFieldTableViewCell.swift @@ -115,6 +115,7 @@ extension MastodonRegisterTextFieldTableViewCell { label.font = MastodonRegisterTextFieldTableViewCell.textFieldLabelFont label.textColor = Asset.Colors.Label.primary.color label.text = text + label.lineBreakMode = .byTruncatingMiddle label.translatesAutoresizingMaskIntoConstraints = false containerView.addSubview(label) @@ -123,6 +124,7 @@ extension MastodonRegisterTextFieldTableViewCell { label.leadingAnchor.constraint(equalTo: paddingView.trailingAnchor), containerView.trailingAnchor.constraint(equalTo: label.trailingAnchor, constant: 16), label.bottomAnchor.constraint(equalTo: containerView.bottomAnchor), + label.widthAnchor.constraint(lessThanOrEqualToConstant: 180).priority(.required - 1), ]) return containerView }()