修复确认按钮正常模式下不可见的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 21:49:09 +08:00
parent 885f56218e
commit 711693f09a
@@ -71,7 +71,7 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
let bgImage = renderer.image { ctx in
let gradient = CGGradient(
colorsSpace: CGColorSpaceCreateDeviceRGB(),
colors: [UIColor(white: 1, alpha: 0.65).cgColor, UIColor(white: 1, alpha: 0.2).cgColor] as CFArray,
colors: [UIColor(red: 0.6, green: 0.75, blue: 0.95, alpha: 0.7).cgColor, UIColor(red: 0.3, green: 0.55, blue: 0.85, alpha: 0.45).cgColor] as CFArray,
locations: [0, 0.5]
)!
ctx.cgContext.drawLinearGradient(gradient,
@@ -79,15 +79,9 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
}
glassButton.setBackgroundImage(bgImage, for: .normal)
var titleConfig = UIButton.Configuration.plain()
titleConfig.title = "确认"
titleConfig.baseForegroundColor = .white
titleConfig.titleTextAttributesTransformer = UIConfigurationTextAttributesTransformer { incoming in
var outgoing = incoming
outgoing.font = .systemFont(ofSize: 16, weight: .semibold)
return outgoing
}
glassButton.configuration = titleConfig
glassButton.setTitle("确认", for: .normal)
glassButton.setTitleColor(.white, for: .normal)
glassButton.titleLabel?.font = .systemFont(ofSize: 16, weight: .semibold)
glassButton.addAction(UIAction { [weak self] _ in
self?.onSubmit?()
}, for: .touchUpInside)