详情页移除入场动画、标题显示分类名,汉选英播放按钮选答后才显示

This commit is contained in:
2026-07-18 23:58:50 +08:00
parent c3a4990984
commit def92715ac
3 changed files with 17 additions and 18 deletions
@@ -28,6 +28,12 @@ final class QuizViewController: UIViewController {
private let promptStack = UIStackView()
private let inputStack = UIStackView()
private let resultStack = UIStackView()
private let navSpeakerItem = UIBarButtonItem(
image: UIImage(systemName: "speaker.wave.2.fill"),
style: .plain,
target: nil,
action: nil
)
private var current: QuizQuestion? {
questions.indices.contains(currentIndex) ? questions[currentIndex] : nil
@@ -110,12 +116,9 @@ final class QuizViewController: UIViewController {
nextButton.configuration = nextConfig
nextButton.addAction(UIAction { [weak self] _ in self?.primaryButtonTapped() }, for: .touchUpInside)
navigationItem.rightBarButtonItem = UIBarButtonItem(
image: UIImage(systemName: "speaker.wave.2.fill"),
style: .plain,
target: self,
action: #selector(speakCurrentWord)
)
navSpeakerItem.target = self
navSpeakerItem.action = #selector(speakCurrentWord)
navigationItem.rightBarButtonItem = navSpeakerItem
let headerStack = UIStackView(arrangedSubviews: [progressView, countLabel])
headerStack.axis = .vertical
@@ -163,6 +166,8 @@ final class QuizViewController: UIViewController {
resultLabel.isHidden = true
resultPhoneticLabel.isHidden = true
navigationItem.rightBarButtonItem = config.mode == .zhToEn ? nil : navSpeakerItem
let isSpelling = config.mode == .spelling
let isDictation = config.mode == .dictation
let isChoice = !isSpelling && !isDictation
@@ -290,6 +295,7 @@ final class QuizViewController: UIViewController {
icon.transform = .identity
}
}
navigationItem.rightBarButtonItem = navSpeakerItem
showResult(correct, for: question)
}