60 lines
1.8 KiB
Swift
60 lines
1.8 KiB
Swift
//
|
|
// MPPositive_MoreOperationPlayListTableViewCell.swift
|
|
// relax.offline.mp3.music
|
|
//
|
|
// Created by Mr.Zhou on 2024/6/24.
|
|
//
|
|
|
|
import UIKit
|
|
///更多-常用cell
|
|
class MPPositive_MoreOperationShowTableViewCell: UITableViewCell {
|
|
//icon
|
|
private lazy var iconImageView:UIImageView = {
|
|
let imageView:UIImageView = .init()
|
|
|
|
return imageView
|
|
}()
|
|
//标题
|
|
private lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 14*width, weight: .regular), textColor: .white, textAlignment: .left)
|
|
var title:String!{
|
|
didSet{
|
|
titleLabel.text = title
|
|
iconImageView.image = UIImage(named: title)
|
|
}
|
|
}
|
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
selectionStyle = .none
|
|
backgroundColor = .clear
|
|
configure()
|
|
}
|
|
required init?(coder: NSCoder) {
|
|
super.init(coder: coder)
|
|
}
|
|
private func configure() {
|
|
contentView.addSubview(iconImageView)
|
|
iconImageView.snp.makeConstraints { make in
|
|
make.width.height.equalTo(24*width)
|
|
make.top.equalToSuperview().offset(12*width).priority(999)
|
|
make.bottom.equalToSuperview().offset(-12*width)
|
|
make.left.equalToSuperview().offset(18*width)
|
|
}
|
|
contentView.addSubview(titleLabel)
|
|
titleLabel.snp.makeConstraints { make in
|
|
make.centerY.equalToSuperview()
|
|
make.left.equalTo(iconImageView.snp.right).offset(12*width)
|
|
}
|
|
}
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
// Initialization code
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
}
|