宽窄优行-由【嘉易行】项目成品而来
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
//
//  MessageView.swift
//  WashCar
//
//  Created by alvin_y on 2020/7/9.
//  Copyright © 2020 yangwang. All rights reserved.
//
 
import Foundation
import UIKit
class MessageView: UIView {
 
    let view_background = UIView()
    let label = UILabel()
 
    init(string: String?, textColor: UIColor) {
        super.init(frame: .zero)
        
        addSubview(view_background)
        
        label.text = string
        label.textColor = textColor
        label.font = UIFont.systemFont(ofSize: 14)
        label.numberOfLines = 0
        addSubview(label)
        
        view_background.snp.makeConstraints { (make) in
            make.edges.equalTo(self)
        }
        
        label.snp.makeConstraints { (make) in
            make.edges.equalTo(view_background).inset(UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10))
        }
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}