49 lines
1.5 KiB
Swift
49 lines
1.5 KiB
Swift
//
|
|
// MPPositive_RecommendMemberCollectionViewCell.swift
|
|
// MusicPlayer
|
|
//
|
|
// Created by Mr.Zhou on 2024/5/20.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MPPositive_RecommendMemberCollectionViewCell: UICollectionViewCell {
|
|
///艺术家头像
|
|
private lazy var avatarImageView:UIImageView = {
|
|
let imageView:UIImageView = .init()
|
|
imageView.contentMode = .scaleAspectFill
|
|
imageView.layer.masksToBounds = true
|
|
imageView.layer.cornerRadius = 25*width
|
|
return imageView
|
|
}()
|
|
private lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 14*width, weight: .regular), textColor: .white, textAlignment: .left)
|
|
var itemView:MPPositive_BrowseItemViewModel! {
|
|
didSet{
|
|
itemView.setUrltoImage(avatarImageView)
|
|
titleLabel.text = itemView.title
|
|
}
|
|
}
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
backgroundColor = .clear
|
|
configure()
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
super.init(coder: coder)
|
|
}
|
|
private func configure() {
|
|
addSubview(avatarImageView)
|
|
avatarImageView.snp.makeConstraints { make in
|
|
make.left.top.right.equalToSuperview()
|
|
make.height.equalTo(50*width)
|
|
}
|
|
addSubview(titleLabel)
|
|
titleLabel.snp.makeConstraints { make in
|
|
make.top.equalTo(avatarImageView.snp.bottom).offset(8*width)
|
|
make.left.right.equalToSuperview()
|
|
}
|
|
|
|
}
|
|
}
|