CNLiveMineHeaderView.swift 2.04 KB
//
//  CNLiveMineHeaderView.swift
//  metaCode
//
//  Created by open on 2023/6/7.
//

import Foundation


class MineHeaderView : UIView {
    
    lazy var iconView : UIImageView = {
       
        let iconView = UIImageView.init()
        iconView.image = UIImage(named: "mine_header_icon_defult_ava")
        iconView.backgroundColor = .clear
        iconView.layer.cornerRadius = 20
        iconView.layer.masksToBounds = true
        iconView.contentMode = .scaleToFill
        return iconView
    }()
    
    lazy var nameLabel: UILabel = {
        let nameLabel = UILabel.init()
        nameLabel.text = UserInfoManager.shared.userInfo.nickName
        nameLabel.textColor = .white
        nameLabel.font = Font_16
        return nameLabel
    }()
    
    lazy var tipBtn: UIButton = {
        let tipBtn = UIButton(type: .custom)
        tipBtn.backgroundColor = .clear
        tipBtn.setImage(UIImage(named: "mine_header_icon_notice"), for: .normal)
        tipBtn.imageView?.contentMode = .scaleToFill
        tipBtn.addTarget(self, action: #selector(tipBtnAction), for: .touchUpInside)
        return tipBtn
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = .clear
        
        addSubview(iconView)
        iconView.snp.makeConstraints { make in
            make.centerY.equalToSuperview().offset(10)
            make.left.equalToSuperview().offset(20)
            make.size.equalTo(60)
        }
        addSubview(nameLabel)
        nameLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview().offset(10)
            make.left.equalTo(iconView.snp.right).offset(15)
        }
        addSubview(tipBtn)
        tipBtn.snp.makeConstraints { make in
            make.centerY.equalToSuperview().offset(10)
            make.right.equalToSuperview().offset(-15)
            make.size.equalTo(30)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    @objc func tipBtnAction() {
        
    }
    
}