61 lines
1.9 KiB
Swift
61 lines
1.9 KiB
Swift
//
|
|
// MicSeatGiftNumView.swift
|
|
// yinmeng-ios
|
|
//
|
|
// Created by duoban on 2024/3/8.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class MicSeatGiftValueView: UIView {
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
setUILayout()
|
|
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
private func setUILayout(){
|
|
addSubview(backgroundView)
|
|
backgroundView.addSubview(giftIconView)
|
|
backgroundView.addSubview(numView)
|
|
|
|
backgroundView.snp.makeConstraints { make in
|
|
make.edges.equalTo(self)
|
|
}
|
|
giftIconView.snp.makeConstraints { make in
|
|
make.leading.equalTo(UIDevice.scaleWidth(width: 4))
|
|
make.centerY.equalTo(backgroundView)
|
|
make.width.height.equalTo(UIDevice.scaleWidth(width: 11))
|
|
}
|
|
numView.snp.makeConstraints { make in
|
|
make.leading.equalTo(giftIconView.snp.trailing).offset((UIDevice.scaleWidth(width: 3)))
|
|
make.centerY.equalTo(giftIconView)
|
|
make.trailing.equalTo(-UIDevice.scaleWidth(width: 4))
|
|
}
|
|
}
|
|
//MARK: - 懒加载
|
|
private lazy var backgroundView:UIView = {
|
|
let _backgroundView = UIView()
|
|
_backgroundView.backgroundColor = ThemeColor(hexStr: "#FFFFFF", alpha: 0.3)
|
|
_backgroundView.layer.cornerRadius = UIDevice.scaleWidth(width: 16)/2
|
|
_backgroundView.layer.masksToBounds = true
|
|
return _backgroundView
|
|
}()
|
|
private lazy var giftIconView:UIImageView = {
|
|
let _giftIconView = UIImageView()
|
|
_giftIconView.isUserInteractionEnabled = true
|
|
_giftIconView.image = UIImage(named: "room_mic_gift_value_icon")
|
|
|
|
return _giftIconView
|
|
}()
|
|
private lazy var numView:UILabel = {
|
|
let _numView = UILabel.getCustomLabel(text: "0",font: UIFont.getScaleFont(ofSize: 10, weight: .regular),color: .white)
|
|
|
|
return _numView
|
|
}()
|
|
}
|