1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // IHEquipmentCell.swift
- // Inhealth
- //
- // Created by weclouds on 2019/12/11.
- // Copyright © 2019 weclouds. All rights reserved.
- //
- import UIKit
- class IHEquipmentCell: UITableViewCell {
- var model :EquipmentViewCellModel?{
- didSet{
- if let model = self.model {
- if let icon = model.icon,let title = model.title,let value = model.value,let isAlert = model.isAlert {
- iconImageV.image = UIImage(named: icon )
- titleLabel.text = title
- valueLabel.text = value
- if isAlert == true {
- self.contentView.backgroundColor = UIColor(hexString: "#FFF3F3")
- self.valueLabel.textColor = UIColor(hexString: "#FF0C4D")
-
- }else{
- self.contentView.backgroundColor = UIColor(hexString: "#F6F8F7")
- self.valueLabel.textColor = UIColor(hexString: "#333333")
- }
- }
-
-
- }
- }
- }
-
- @IBOutlet weak var iconImageV: UIImageView!
-
- @IBOutlet weak var titleLabel: UILabel!
-
- @IBOutlet weak var valueLabel: UILabel!
-
- override func awakeFromNib() {
- super.awakeFromNib()
- // Initialization code
- }
- override func setSelected(_ selected: Bool, animated: Bool) {
- super.setSelected(selected, animated: animated)
- // Configure the view for the selected state
- }
-
- override var frame: CGRect{
- set(newFrame){
- var frame = newFrame
- frame.origin.x = frame.origin.x + 20 //递归
- frame.origin.y = frame.origin.y + 5
- frame.size.width -= 40
- frame.size.height -= 10
- super.frame = frame
- }
- get{
- return super.frame
- }
- }
- }
|