From a1ac0f1634ff0bd8f04259fc4cf7ebabd8c8c82d Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期二, 10 十月 2023 16:40:52 +0800 Subject: [PATCH] 修复BUG --- WanPai/Common/View/CommonAlertView.swift | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/WanPai/Common/View/CommonAlertView.swift b/WanPai/Common/View/CommonAlertView.swift index fb0bcef..62efd30 100644 --- a/WanPai/Common/View/CommonAlertView.swift +++ b/WanPai/Common/View/CommonAlertView.swift @@ -13,7 +13,9 @@ @IBOutlet weak var view_container: UIView! @IBOutlet weak var label_title: UILabel! @IBOutlet weak var label_content: UILabel! - + @IBOutlet weak var btn_cancel: UIButton! + @IBOutlet weak var btn_complete: UIButton! + private var title:String! private var content:String! private var clouse:((Bool)->Void)! @@ -26,10 +28,11 @@ } - static func show(title:String,content:String, clouse:@escaping (Bool)->Void){ + static func show(title:String,content:String,isSingle:Bool = false, clouse:@escaping (Bool)->Void){ let alertView = CommonAlertView.jq_loadNibView() alertView.label_title.text = title alertView.label_content.text = content + alertView.btn_cancel.isHidden = isSingle alertView.clouse = clouse alertView.frame = sceneDelegate?.window?.frame ?? .zero sceneDelegate?.window?.addSubview(alertView) @@ -39,9 +42,10 @@ } } - static func show(title:String,attribute:NSMutableAttributedString, clouse:@escaping (Bool)->Void){ + static func show(title:String,attribute:NSMutableAttributedString,isSingle:Bool = false, clouse:@escaping (Bool)->Void){ let alertView = CommonAlertView.jq_loadNibView() alertView.label_title.text = title + alertView.btn_cancel.isHidden = isSingle alertView.label_content.attributedText = attribute alertView.clouse = clouse alertView.frame = sceneDelegate?.window?.frame ?? .zero @@ -52,6 +56,11 @@ } } + override func layoutSubviews() { + super.layoutSubviews() + btn_complete.localGradientColor(cornerRadius: 20) + } + @IBAction func closeAction(_ sender: UIButton) { UIView.animate(withDuration: 0.4) { -- Gitblit v1.7.1