From 50260473dbb1bf4596f9f6ead4a265ca7ee4d5b3 Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期五, 30 八月 2024 14:36:56 +0800 Subject: [PATCH] fix UI --- XQMuse/Root/Other/View/CountdownChooseListView.swift | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/XQMuse/Root/Other/View/CountdownChooseListView.swift b/XQMuse/Root/Other/View/CountdownChooseListView.swift index 056ac45..b2bc2b7 100644 --- a/XQMuse/Root/Other/View/CountdownChooseListView.swift +++ b/XQMuse/Root/Other/View/CountdownChooseListView.swift @@ -17,6 +17,7 @@ @IBOutlet weak var cons_bottom: NSLayoutConstraint! @IBOutlet weak var tf_input: UITextField! private var disposeBag = DisposeBag() + private var clouse:((Int)->Void)? var numberMinutes = 1 override func awakeFromNib() { @@ -34,6 +35,7 @@ let rect = obj[UIResponder.keyboardFrameEndUserInfoKey] as! CGRect let duration = obj[UIResponder.keyboardAnimationDurationUserInfoKey] as! CGFloat self.layoutIfNeeded() + self.userCustomer() UIView.animate(withDuration:duration) { self.cons_bottom.constant = rect.height self.layoutIfNeeded() @@ -59,8 +61,9 @@ } - static func show(){ + static func show(clouse:@escaping (Int)->Void){ let countdownChooseListView = CountdownChooseListView.jq_loadNibView() + countdownChooseListView.clouse = clouse countdownChooseListView.frame = sceneDelegate?.window?.frame ?? .zero sceneDelegate?.window?.addSubview(countdownChooseListView) @@ -95,6 +98,7 @@ @IBAction func cancelAction(_ sender: UIButton) { endEditing(true) + clouse?(numberMinutes) cons_bottom.constant = -JQ_ScreenH UIView.animate(withDuration: 0.4) { self.alpha = 0 @@ -136,6 +140,15 @@ for v in subView.subviews{ if let label = v as? UILabel{ label.textColor = UIColor(hexString: "#8AAE65") + + switch label.text { + case "关闭倒计时":numberMinutes = -1;break + case "自定义","分钟":numberMinutes = self.tf_input.text!.int ?? 1;break + default: + numberMinutes = label.text?.jq_filterNum().int ?? 0 + self.tf_input.text = numberMinutes.string + + } } if let image = v as? UIImageView{ -- Gitblit v1.7.1