From 1c3d62d46cd52f655521a5ec54cec7c044eb22b9 Mon Sep 17 00:00:00 2001 From: fish Date: Sat, 18 Jul 2026 23:01:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E5=86=99=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E5=88=86=E9=9A=94=E7=BA=BF=20crash=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20HairlineView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LearnEnglish/LearnEnglish/Views/DictationInputView.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LearnEnglish/LearnEnglish/Views/DictationInputView.swift b/LearnEnglish/LearnEnglish/Views/DictationInputView.swift index ff11179..b968475 100644 --- a/LearnEnglish/LearnEnglish/Views/DictationInputView.swift +++ b/LearnEnglish/LearnEnglish/Views/DictationInputView.swift @@ -5,7 +5,7 @@ final class DictationInputView: UIView, UITextFieldDelegate { var onSubmit: (() -> Void)? private let textField = UITextField() - private let bottomLine = UIView() + private let bottomLine = HairlineView() var text: String { textField.text?.trimmingCharacters(in: .whitespaces) ?? "" } var isEmpty: Bool { text.isEmpty } @@ -24,7 +24,6 @@ final class DictationInputView: UIView, UITextFieldDelegate { textField.returnKeyType = .done textField.addTarget(self, action: #selector(textChanged), for: .editingChanged) - bottomLine.backgroundColor = .separator bottomLine.translatesAutoresizingMaskIntoConstraints = false addSubview(textField) @@ -42,7 +41,6 @@ final class DictationInputView: UIView, UITextFieldDelegate { bottomLine.leadingAnchor.constraint(equalTo: textField.leadingAnchor), bottomLine.trailingAnchor.constraint(equalTo: textField.trailingAnchor), bottomLine.bottomAnchor.constraint(equalTo: textField.bottomAnchor), - bottomLine.heightAnchor.constraint(equalToConstant: 1.0 / UITraitCollection().displayScale), ]) }