Commit 18f40d48 authored by Steven杜宇's avatar Steven杜宇

// 我的

parent ecfc017a
...@@ -195,7 +195,42 @@ class YHMyUserInfoView: UIView { ...@@ -195,7 +195,42 @@ class YHMyUserInfoView: UIView {
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalTo(0) make.right.equalTo(0)
} }
update(count: 0, label: likeLabel)
update(count: 0, label: collectLabel)
update(count: 0, label: scanLabel)
}
func update(count: Int, label: UILabel) {
var text = ""
var count = "\(count) "
if label.tag == Self.likeTag {
text = "点赞"
} else if label.tag == Self.collectTag {
text = "收藏"
} else if label.tag == Self.scanTag {
text = "最近浏览"
}
let attrStr = NSMutableAttributedString(string: "")
let countAttrStr = NSAttributedString(
string: count,
attributes: [NSAttributedString.Key.foregroundColor: UIColor.mainTextColor,
NSAttributedString.Key.font: UIFont(name: "DINAlternate-Bold", size: 14)!])
let titleAttrStr = NSAttributedString(
string: text,
attributes: [NSAttributedString.Key.foregroundColor: UIColor.init(hex: 0x435163),
NSAttributedString.Key.font: UIFont.PFSC_R(ofSize: 12)])
attrStr.append(countAttrStr)
attrStr.append(titleAttrStr)
label.attributedText = attrStr
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment