修复任务提交与弹窗交互问题
This commit is contained in:
@ -7,7 +7,7 @@ import SnapKit
|
||||
import UIKit
|
||||
|
||||
/// 设置收款金额弹窗,对齐 Android `SetAmountDialog`。
|
||||
final class PaymentSetAmountDialogView: UIView {
|
||||
final class PaymentSetAmountDialogView: KeyboardAvoidingDialogView {
|
||||
|
||||
var onConfirm: (() -> Void)?
|
||||
var onCancel: (() -> Void)?
|
||||
@ -52,6 +52,8 @@ final class PaymentSetAmountDialogView: UIView {
|
||||
autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
alpha = 0
|
||||
parent.addSubview(self)
|
||||
layoutIfNeeded()
|
||||
amountField.becomeFirstResponder()
|
||||
UIView.animate(withDuration: 0.2) {
|
||||
self.alpha = 1
|
||||
}
|
||||
@ -67,6 +69,8 @@ final class PaymentSetAmountDialogView: UIView {
|
||||
}
|
||||
|
||||
private func setupUI() {
|
||||
keyboardAvoidingContentView = cardView
|
||||
|
||||
dimView.backgroundColor = AppColor.overlayScrim
|
||||
dimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(cancelTapped)))
|
||||
|
||||
@ -146,7 +150,7 @@ final class PaymentSetAmountDialogView: UIView {
|
||||
}
|
||||
cardView.snp.makeConstraints { make in
|
||||
make.leading.trailing.equalToSuperview().inset(AppSpacing.md)
|
||||
make.centerY.equalToSuperview()
|
||||
keyboardAvoidingCenterYConstraint = make.centerY.equalToSuperview().constraint
|
||||
}
|
||||
titleLabel.snp.makeConstraints { make in
|
||||
make.top.leading.trailing.equalToSuperview().inset(AppSpacing.md)
|
||||
|
||||
Reference in New Issue
Block a user