CNLiveDuanjuTitleCell.swift
1.67 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// CNLiveDuanjuTitleCell.swift
// metaCode
//
// Created by zx on 2024/1/10.
// 在追短剧详情页/全部课程详情页 --title cell
import Foundation
class CNLiveDuanjuTitleCell:UITableViewCell{
var _blockName:String?
var blockName:String?{
get{
_blockName
}
set{
_blockName = newValue!
if self.cellType == .course || self.cellType == .playletToCourse{
self.blockTitleLabl.text = _blockName ?? "全部课程"
self.blockTitleLabl.top = KStatusBarHeight+10
}else if self.cellType == .playlet{
self.blockTitleLabl.text = _blockName ?? "在追短剧"
self.blockTitleLabl.top = 10
}
}
}
var cellType:CNLiveHomePageCellType = .course
//MARK: - 懒加载
///区块标题
lazy var blockTitleLabl: UILabel = {
let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: 10, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30))
titleLbl.text = "在追短剧"
titleLbl.font = BoldFont_21
titleLbl.textColor = HexColor("#333333")
return titleLbl
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
setupUI()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupUI() {
contentView.backgroundColor = .white
self.contentView.addSubview(self.blockTitleLabl)
}
}