宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-07-05 0d8f5fc8a516bfd07e425909e4a4432600572ee7
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
//
//  YYTitleWithButtonHeaderView.swift
//  OKProject
//
//  Created by alvin_y on 2020/5/28.
//  Copyright © 2020 yangwang. All rights reserved.
//
 
import UIKit
 
class YYTitleWithButtonHeaderView: UITableViewHeaderFooterView {
 
    var label_title: UILabel!
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        
        setupViews()
        defineLayouts()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
 
    func setupViews() {
        
        contentView.backgroundColor = UIColor.color(light: UIColor.color(hexString: "#F3F4F5"), dark: UIColor.color(hexString: "#F3F4F5"))
        label_title = UILabel()
        label_title.textColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 0.8)
        label_title.font = UIFont.systemFont(ofSize: 16, weight: .medium)
        contentView.addSubview(label_title)
    }
    
    func defineLayouts() {
        
        label_title.snp.makeConstraints { (make) in
            make.left.equalTo(contentView).offset(17)
            make.centerY.equalToSuperview()
        }
    }
}