//
//  SelectView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/5/11.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class SelectView: UIView {
    
    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.init()
        titleLabel.textAlignment = .left
        titleLabel.numberOfLines = 0
        titleLabel.font = UIFont.systemFont(ofSize: 11.33)
        titleLabel.textColor = UIColorFromRGB(rgbValue: 0x8792A4)
        self.addSubview(titleLabel)
        return titleLabel
    }()
    lazy var subLabel: UILabel = {
        let subLabel = UILabel.init()
        subLabel.textAlignment = .left
        subLabel.numberOfLines = 0
        subLabel.font = UIFont.systemFont(ofSize: 11.33)
        subLabel.textColor = UIColorFromRGB(rgbValue: 0x8792A4)
        self.addSubview(subLabel)
        return subLabel
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.titleLabel.frame = CGRect(x:10, y: 0, width:160 , height:self.height )
        self.subLabel.frame = CGRect(x:titleLabel.originX+titleLabel.width+10, y: 0, width:SCREEN_WHIDTH()-(titleLabel.originX+titleLabel.width+10) , height:self.height )
    }
    func setTitle(title:String?,subTitle:String?){
        let title:String = "当前选择的系统："+judgmentStrNil(str: title) + " 用户信息："
        self.titleLabel.frame = CGRect(x:10, y: 0, width:getTexWidth(textStr: title, font: UIFont.systemFont(ofSize: 11.33), height: self.height) , height:self.height )
        self.subLabel.frame = CGRect(x:titleLabel.originX+titleLabel.width, y: 0, width:SCREEN_WHIDTH()-(titleLabel.originX+titleLabel.width+10) , height:self.height )
        self.titleLabel.text = title
        self.subLabel.text = judgmentStrNil(str: subTitle)
        print(subTitle!)
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    

}
