CNDownSlideCell.swift
2.27 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
58
59
60
61
62
63
//
// CNDownSlideCell.swift
// metaCode
//
// Created by zx on 2023/10/16.
//
import Foundation
import UIKit
enum GlobalConstants {
static let leftMargin: CGFloat = 20
static let toDayCardRowH: CGFloat = 440
static let toDayCardCornerRadius: CGFloat = 15.0
static let todayCardSize: CGSize = CGSize(width: KSreenWidth - 2 * 20, height: 410)
static let cardDetailTopImageH: CGFloat = 500
static let iconBorderColor: CGColor = UIColor(red: 239/255.0, green: 240/255.0, blue: 241/255.0, alpha: 1).cgColor
static let iconBorderWidth: CGFloat = 0.8
static let iconCornerRadius: CGFloat = 17.5
static let textBlueColor = UIColor(red: 0/255.0, green: 122/255.0, blue: 255/255.0, alpha: 1.0) //007AFF
static let speratorLineColor = UIColor(red: 224/255.0, green: 224/255.0, blue: 224/255.0, alpha: 1)
}
class CNDownSlideCell: UITableViewCell {
let bgBackView = UIView()
let bgImageView = UIImageView()
let emptyView = UIView()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupUI() {
contentView.addSubview(bgBackView)
bgBackView.addSubview(bgImageView)
contentView.addSubview(emptyView)
bgBackView.frame = CGRect(x: GlobalConstants.leftMargin, y: 0, width: GlobalConstants.todayCardSize.width, height: GlobalConstants.todayCardSize.height)
bgBackView.layer.shadowColor = UIColor.black.cgColor
bgBackView.layer.shadowOpacity = 0.4
bgBackView.layer.shadowOffset = CGSize(width: 0, height: 1)
bgImageView.frame = bgBackView.bounds
bgImageView.contentMode = .scaleAspectFill
bgImageView.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius
bgImageView.layer.masksToBounds = true
emptyView.backgroundColor = UIColor.white.withAlphaComponent(0)
emptyView.frame = CGRect(x: 0, y: bgImageView.frame.size.height, width: GlobalConstants.todayCardSize.width, height: GlobalConstants.toDayCardRowH - GlobalConstants.todayCardSize.height)
}
}