颜色单词增加颜色圆点指示

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 21:35:25 +08:00
parent 6dd8ebc718
commit 13ca0bcda9
6 changed files with 96 additions and 23 deletions
@@ -87,6 +87,19 @@ final class WordDetailViewController: UIViewController {
wordLabel.font = Theme.Font.wordHero()
wordLabel.textAlignment = .center
let colorDot = ColorDotView()
colorDot.backgroundColor = word.color
colorDot.isHidden = word.color == nil
colorDot.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
colorDot.widthAnchor.constraint(equalToConstant: 20),
colorDot.heightAnchor.constraint(equalToConstant: 20)
])
let wordRow = UIStackView(arrangedSubviews: [colorDot, wordLabel])
wordRow.axis = .horizontal
wordRow.alignment = .center
wordRow.spacing = 12
let phoneticIcon = UIImageView(image: UIImage(
systemName: "speaker.wave.2",
withConfiguration: UIImage.SymbolConfiguration(pointSize: 13, weight: .medium)))
@@ -115,7 +128,7 @@ final class WordDetailViewController: UIViewController {
speakButton.heightAnchor.constraint(equalToConstant: 56)
])
let stack = UIStackView(arrangedSubviews: [wordLabel, phoneticRow, speakButton])
let stack = UIStackView(arrangedSubviews: [wordRow, phoneticRow, speakButton])
stack.axis = .vertical
stack.spacing = 16
stack.alignment = .center