格式化文本框背景浅色固定白色深色使用次级背景

This commit is contained in:
2026-07-12 22:07:55 +08:00
parent b31ffc1c83
commit 87deb5d9f2
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -34,7 +34,9 @@ class FormatLogViewController: UIViewController {
textView = UITextView() textView = UITextView()
textView.translatesAutoresizingMaskIntoConstraints = false textView.translatesAutoresizingMaskIntoConstraints = false
textView.font = UIFont.systemFont(ofSize: 16) textView.font = UIFont.systemFont(ofSize: 16)
textView.backgroundColor = .systemBackground textView.backgroundColor = UIColor { traitCollection in
traitCollection.userInterfaceStyle == .dark ? .secondarySystemBackground : .white
}
textView.layer.cornerRadius = 12 textView.layer.cornerRadius = 12
textView.layer.borderWidth = 0.5 textView.layer.borderWidth = 0.5
textView.layer.borderColor = UIColor.separator.cgColor textView.layer.borderColor = UIColor.separator.cgColor
+3 -1
View File
@@ -34,7 +34,9 @@ class FormatNoteViewController: UIViewController {
private func setupUI() { private func setupUI() {
textView = UITextView() textView = UITextView()
textView.translatesAutoresizingMaskIntoConstraints = false textView.translatesAutoresizingMaskIntoConstraints = false
textView.backgroundColor = .systemBackground textView.backgroundColor = UIColor { traitCollection in
traitCollection.userInterfaceStyle == .dark ? .secondarySystemBackground : .white
}
textView.layer.cornerRadius = 12 textView.layer.cornerRadius = 12
textView.layer.borderWidth = 0.5 textView.layer.borderWidth = 0.5
textView.layer.borderColor = UIColor.separator.cgColor textView.layer.borderColor = UIColor.separator.cgColor