Music_Player3/relax.offline.mp3.music/MP/MPPositive/Views/Player/MPPositive_PlayerLyricView.swift
2024-06-03 15:34:16 +08:00

62 lines
2.4 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MPPositive_PlayerLyricView.swift
// MusicPlayer
//
// Created by Mr.Zhou on 2024/5/8.
//
import UIKit
//BView()
class MPPositive_PlayerLyricView: UIView {
///
lazy var titleLabel:UILabel = createLabel(font: .systemFont(ofSize: 20*width, weight: .regular), textColor: .init(hex: "#FFFFFF", alpha: 0.85), textAlignment: .left)
///
lazy var subtitleLabel:UILabel = createLabel(font: .systemFont(ofSize: 12*width, weight: .regular), textColor: .init(hex: "#EEEEEE", alpha: 0.45), textAlignment: .left)
//ScrollView
lazy var scrollView:UIScrollView = {
let scrollView = UIScrollView()
scrollView.backgroundColor = .clear
scrollView.showsVerticalScrollIndicator = false
scrollView.showsHorizontalScrollIndicator = false
scrollView.addSubview(lyricsLabel)
scrollView.contentSize = .init(width: screen_Width, height: lyricsLabel.frame.origin.y + lyricsLabel.frame.height)
lyricsLabel.snp.makeConstraints { make in
make.width.equalToSuperview().multipliedBy(0.89)
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(15*width)
make.bottom.equalToSuperview().offset(-30*width)
}
return scrollView
}()
///Label
lazy var lyricsLabel:UILabel = createLabel(font: .systemFont(ofSize: 16*width, weight: .regular), textColor: .init(hex: "#FFFFFF", alpha: 0.85), textAlignment: .left, lines: 0)
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .clear
configure()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
//
private func configure() {
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(33*width)
make.left.equalToSuperview().offset(18*width)
make.right.equalToSuperview().offset(-18*width)
}
addSubview(subtitleLabel)
subtitleLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(10*width)
make.left.right.equalTo(titleLabel)
}
addSubview(scrollView)
scrollView.snp.makeConstraints { make in
make.top.equalTo(subtitleLabel.snp.bottom).offset(10*width)
make.left.right.bottom.equalToSuperview()
}
}
}