You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.2 KiB
78 lines
2.2 KiB
![]()
2 years ago
|
//
|
||
|
// HealthBlockView.swift
|
||
![]()
1 year ago
|
// FireBoltt
|
||
![]()
2 years ago
|
//
|
||
|
// Created by lemo. on 2020/4/8.
|
||
|
// Copyright © 2020 Sheldon. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import UIKit
|
||
|
|
||
|
class HealthBlockView: UIView {
|
||
|
|
||
![]()
1 year ago
|
lazy var fb_bgImgBtn: UIButton = {
|
||
![]()
2 years ago
|
let btn = UIButton()
|
||
|
btn.isEnabled = false
|
||
|
return btn
|
||
|
}()
|
||
![]()
1 year ago
|
lazy var fb_titleLabel: UILabel = {
|
||
![]()
2 years ago
|
let label = UILabel()
|
||
|
label.font = SystemRegularFont(12)
|
||
|
label.textColor = kHexColor(0x666666)
|
||
|
return label
|
||
|
}()
|
||
![]()
1 year ago
|
lazy var fb_centerLabel: UILabel = {
|
||
![]()
2 years ago
|
let label = UILabel()
|
||
|
label.font = DigitalFont(32)
|
||
|
return label
|
||
|
}()
|
||
![]()
1 year ago
|
lazy var fb_unitLabel: UILabel = {
|
||
![]()
2 years ago
|
let label = UILabel()
|
||
|
label.font = SystemRegularFont(12)
|
||
|
return label
|
||
|
}()
|
||
![]()
1 year ago
|
lazy var fb_sleepCircleView: CircleView = {
|
||
![]()
2 years ago
|
let view = CircleView(lineWidth: 5, bottomColor: kHexColor(0xE5EEFF), progressColor: kHexColor(0x59AAFF), type: .base)
|
||
![]()
2 years ago
|
view.isUserInteractionEnabled = false
|
||
|
return view
|
||
|
}()
|
||
|
|
||
|
override init(frame: CGRect) {
|
||
|
super.init(frame: frame)
|
||
![]()
1 year ago
|
addSubview(fb_bgImgBtn)
|
||
|
addSubview(fb_titleLabel)
|
||
|
addSubview(fb_centerLabel)
|
||
|
addSubview(fb_unitLabel)
|
||
|
addSubview(fb_sleepCircleView)
|
||
![]()
2 years ago
|
layoutUI()
|
||
|
}
|
||
|
|
||
|
func layoutUI() {
|
||
![]()
1 year ago
|
fb_bgImgBtn.snp.makeConstraints { (make) in
|
||
![]()
2 years ago
|
make.edges.equalToSuperview()
|
||
|
}
|
||
![]()
1 year ago
|
fb_titleLabel.snp.makeConstraints { (make) in
|
||
![]()
2 years ago
|
make.top.equalTo(15)
|
||
|
make.centerX.equalToSuperview()
|
||
|
}
|
||
![]()
1 year ago
|
fb_centerLabel.snp.makeConstraints { (make) in
|
||
![]()
2 years ago
|
make.top.equalTo(kScaleWidth(64))
|
||
|
make.centerX.equalToSuperview()
|
||
|
}
|
||
![]()
1 year ago
|
fb_unitLabel.snp.makeConstraints { (make) in
|
||
|
make.top.equalTo(fb_centerLabel.snp.bottom)
|
||
![]()
2 years ago
|
make.centerX.equalToSuperview()
|
||
|
}
|
||
![]()
1 year ago
|
fb_sleepCircleView.snp.makeConstraints { (make) in
|
||
![]()
2 years ago
|
make.top.equalTo(45)
|
||
|
make.width.height.equalTo(kScaleWidth(90))
|
||
|
make.centerX.equalToSuperview()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
required init?(coder: NSCoder) {
|
||
|
fatalError("init(coder:) has not been implemented")
|
||
|
}
|
||
|
|
||
|
}
|