修复确认按钮正常模式下不可见的问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
|
|||||||
let bgImage = renderer.image { ctx in
|
let bgImage = renderer.image { ctx in
|
||||||
let gradient = CGGradient(
|
let gradient = CGGradient(
|
||||||
colorsSpace: CGColorSpaceCreateDeviceRGB(),
|
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]
|
locations: [0, 0.5]
|
||||||
)!
|
)!
|
||||||
ctx.cgContext.drawLinearGradient(gradient,
|
ctx.cgContext.drawLinearGradient(gradient,
|
||||||
@@ -79,15 +79,9 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
|
|||||||
}
|
}
|
||||||
glassButton.setBackgroundImage(bgImage, for: .normal)
|
glassButton.setBackgroundImage(bgImage, for: .normal)
|
||||||
|
|
||||||
var titleConfig = UIButton.Configuration.plain()
|
glassButton.setTitle("确认", for: .normal)
|
||||||
titleConfig.title = "确认"
|
glassButton.setTitleColor(.white, for: .normal)
|
||||||
titleConfig.baseForegroundColor = .white
|
glassButton.titleLabel?.font = .systemFont(ofSize: 16, weight: .semibold)
|
||||||
titleConfig.titleTextAttributesTransformer = UIConfigurationTextAttributesTransformer { incoming in
|
|
||||||
var outgoing = incoming
|
|
||||||
outgoing.font = .systemFont(ofSize: 16, weight: .semibold)
|
|
||||||
return outgoing
|
|
||||||
}
|
|
||||||
glassButton.configuration = titleConfig
|
|
||||||
glassButton.addAction(UIAction { [weak self] _ in
|
glassButton.addAction(UIAction { [weak self] _ in
|
||||||
self?.onSubmit?()
|
self?.onSubmit?()
|
||||||
}, for: .touchUpInside)
|
}, for: .touchUpInside)
|
||||||
|
|||||||
Reference in New Issue
Block a user