Commit 3048c9af authored by CZ1004's avatar CZ1004

【优化】设置弹窗

parent 77da9609
//
// BaseAlertView.swift
// PhoneManager
//
// Created by edy on 2025/5/9.
//
import Foundation
import SnapKit
class BaseAlertView : UIView {
private var bottomConstraint: Constraint?
override init(frame: CGRect) {
super.init(frame: frame)
// 先显示背景,然后延迟显示弹框
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
UIView.animate(withDuration: 0.1) {
// 更新约束
self.bottomConstraint?.update(offset: 0)
self.layoutIfNeeded()
}
}
}
override func removeFromSuperview() {
UIView.animate(withDuration: 0.2) {
// 更新约束
self.backgroundColor = .clear
self.bottomConstraint?.update(offset: self.height)
self.layoutIfNeeded()
}completion: { _ in
super.removeFromSuperview()
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
......@@ -13,7 +13,7 @@ class ContactBacRestoreAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -12,7 +12,7 @@ class ContactBackUpCompletedAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -14,7 +14,7 @@ class ContactBackUpDeleteCompletedAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -11,7 +11,7 @@ class ContactBackUpNoDataAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -8,12 +8,13 @@
import Foundation
class ContactBackupAlertView : UIView {
var sureCallBack: (Bool)->Void = {isSure in }
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......@@ -124,7 +125,6 @@ class ContactBackupAlertView : UIView {
make.height.equalTo(46)
}
}
@objc private func dismissAlert() {
......
......@@ -13,7 +13,7 @@ class ContactDeleteAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -13,7 +13,7 @@ class ContactMergeAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
......@@ -11,7 +11,7 @@ class ContactRestoreSuccessView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment