//
|
// BackgroundVoiceVC.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/8/14.
|
//
|
|
import UIKit
|
import QMUIKit
|
import JQTools
|
|
class BackgroundVoiceVC: BaseVC {
|
|
@IBOutlet weak var slider_voice: UISlider!
|
@IBOutlet weak var collectionView: UICollectionView!
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
title = "心泉·疗愈"
|
|
}
|
|
override func setUI() {
|
|
let v1 = UIView()
|
v1.backgroundColor = UIColor(hexStr: "#B6DC90")
|
v1.bounds = CGRect(x: 0, y: 0, width: 17, height: 17)
|
v1.jq_borderWidth = 2
|
v1.jq_borderColor = .white
|
v1.jq_cornerRadius = 8.5
|
|
slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .normal)
|
slider_voice.setThumbImage(v1.qmui_snapshotLayerImage(), for: .highlighted)
|
|
collectionView.collectionViewLayout = TestLeftRightCollectionViewFlowLayout(width: JQ_ScreenW, height: 213.5)
|
collectionView.delegate = self
|
collectionView.dataSource = self
|
collectionView.isPagingEnabled = false
|
collectionView.bounces = false
|
collectionView.showsHorizontalScrollIndicator = false
|
collectionView.register(UINib(nibName: "HomeRelaxVoiceCCell", bundle: nil), forCellWithReuseIdentifier: "_HomeRelaxVoiceCCell")
|
collectionView.scrollToItem(at: IndexPath(row: 2, section: 0), at: .centeredHorizontally, animated: true)
|
collectionView.contentInset = UIEdgeInsets(top: 0, left: 100 , bottom: 0, right: 100)
|
}
|
}
|
|
extension BackgroundVoiceVC:UICollectionViewDelegate & UICollectionViewDataSource{
|
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
return 5
|
}
|
|
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxVoiceCCell", for: indexPath) as! HomeRelaxVoiceCCell
|
cell.contentView.backgroundColor = .jq_randomColor
|
return cell
|
}
|
}
|
|
extension BackgroundVoiceVC:UICollectionViewDelegateFlowLayout{
|
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
return CGSize(width: 148.25, height: 213.45)
|
}
|
}
|