杨锴
2024-08-14 909e20941e45f8712c012db602034b47da0bfdb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
//  PlaySettingView.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/14.
//
 
import UIKit
import QMUIKit
import JQTools
 
class PlaySettingView: UIView,JQNibView{
                @IBOutlet weak var slider_voice: UISlider!
                @IBOutlet weak var cons_bottom: NSLayoutConstraint!
                
                override func awakeFromNib() {
                                super.awakeFromNib()
 
                                alpha = 0
                                cons_bottom.constant = -JQ_ScreenW
 
                                let v1 = UIView()
                                v1.backgroundColor = UIColor(hexStr: "#B6DC90")
                                v1.bounds = CGRect(x: 0, y: 0, width: 17, height: 17)
                                v1.jq_borderWidth = 2
                                v1.jq_borderColor = .white
                                v1.jq_cornerRadius = 8.5
 
                                slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .normal)
                                slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .highlighted)
 
                                layoutIfNeeded()
                }
 
                static func show(){
                                let settingView = PlaySettingView.jq_loadNibView()
                                settingView.frame = sceneDelegate?.window?.frame ?? .zero
                                sceneDelegate?.window?.addSubview(settingView)
 
                                settingView.cons_bottom.constant = 65.5
 
                                UIView.animate(withDuration: 0.4) {
                                                settingView.alpha = 1
                                                settingView.layoutIfNeeded()
                                }
                }
 
                @IBAction func hiddenAction(_ sender: UIButton) {
                                self.cons_bottom.constant = -JQ_ScreenW
                                UIView.animate(withDuration: 0.4) {
                                                self.alpha = 0
                                                self.layoutIfNeeded()
                                } completion: { _ in
                                                self.removeFromSuperview()
                                }
                }
}