无故事王国
2023-06-28 a56ff03fc62bb894160f9b71fc54f66e77e48712
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
//  StudentReportVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/6/26.
//
 
import UIKit
import JQTools
 
class StudentReportVC: BaseVC {
 
    @IBOutlet weak var label_stu_hei: UILabel!
    @IBOutlet weak var label_stu_wei: UILabel!
    @IBOutlet weak var label_stu_BMI: UILabel!
 
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "测试报告"
    }
 
    override func setUI() {
        label_stu_hei.attributedText = setAttribute(t1: "0", t2: "cm")
        label_stu_wei.attributedText = setAttribute(t1: "0", t2: "kg")
        label_stu_BMI.attributedText = setAttribute(t1: "0.0", t2: "正常")
    }
 
    private func setAttribute(t1:String,t2:String)->NSMutableAttributedString{
        let color:UIColor = UIColor(hexStr: "#2F5264")
        let a1 = AttributedStringbuilder()
        a1.add(string: t1, withFont: UIFont.systemFont(ofSize: 26), withColor: color)
            .add(string: t2, withFont: UIFont.systemFont(ofSize: 16), withColor: color)
        return a1.mutableAttributedString
    }
 
}