//
//  HelpBtnItemView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/8.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class HelpBtnItemView: UIView {

    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.init()
        titleLabel.textAlignment = .left
        titleLabel.numberOfLines = 0
        titleLabel.font = UIFont.test_systemFont(ofSize: 14)
        titleLabel.textColor = UIColorFromRGB(rgbValue: 0x6E7787)
        self.addSubview(titleLabel)
        return titleLabel
    }()
    lazy var subImageView: UIImageView = {
        let subImageView = UIImageView.init()
        //subImageView.contentMode = .scaleToFill
        subImageView.contentMode = .scaleAspectFill
        self.addSubview(subImageView)
        return subImageView
    }()
    lazy var button : UIButton = {
        let button = UIButton.init(type: .custom)
        self.addSubview(button)
        return button
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        
    }
    func addView(title:String,imageName:String){
        subImageView.frame = CGRect(x:26, y: 15, width:15 , height:15 )
        titleLabel.frame = CGRect(x:subImageView.originX+25, y: subImageView.originY, width:self.width-(subImageView.originX+10) , height:15 )
        subImageView.image = UIImage.init(named: imageName)
        titleLabel.text = title
        button.frame = CGRect(x:0, y: 0, width:self.width , height:self.height)
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
