Music_Player3/MusicPlayer/MP/Common/Extension(扩展)/TableView.swift
Mr.zhou 96147c5e37 项目:Musicoo
版本:A面 1.0
构建:1.1
更新内容:对项目A面功能的实现,经测试确定各项功能无问题。
更新时间:2024年4月12日 11:20
上传状态:已上传App Connect
2024-04-12 11:19:58 +08:00

34 lines
977 B
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.

//
// TableView.swift
// MusicPlayer
//
// Created by Mr.Zhou on 2024/4/11.
//
import UIKit
extension UITableView {
/// tableViewsection
/// - Parameter count: cell
func showMessage(_ count:Int, title:String = "No data"){
if count == 0 {
let view = UIView()
view.frame = frame
view.backgroundColor = .clear
//
let imageView = UIImageView(image: UIImage(named: "empty"))
imageView.contentMode = .scaleAspectFill
view.addSubview(imageView)
imageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().multipliedBy(0.9)
make.width.equalTo(211*width)
make.height.equalTo(172*width)
}
backgroundView = view
}else{
backgroundView = nil
}
}
}