45 lines
1.3 KiB
Swift
45 lines
1.3 KiB
Swift
//
|
|
// MPPositive_SearchSuggestionItemTableViewCell.swift
|
|
// MusicPlayer
|
|
//
|
|
// Created by Mr.Zhou on 2024/5/12.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MPPositive_SearchSuggestionItemTableViewCell: UITableViewCell {
|
|
private lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 14*width, weight: .medium), textColor: .white, textAlignment: .left)
|
|
var item:NSAttributedString!{
|
|
didSet{
|
|
titleLabel.attributedText = item
|
|
}
|
|
}
|
|
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)
|
|
}
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
private func configure() {
|
|
contentView.addSubview(titleLabel)
|
|
titleLabel.snp.makeConstraints { make in
|
|
make.centerY.equalToSuperview()
|
|
make.left.equalToSuperview().offset(18*width)
|
|
make.right.equalToSuperview().offset(-18*width)
|
|
}
|
|
}
|
|
}
|