12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- //
- // PublishMusicView.swift
- // RainbowPlanet
- //
- // Created by Christopher on 2019/6/23.
- // Copyright © 2019 RainbowPlanet. All rights reserved.
- // 音乐选择のView
- import UIKit
- class PublishMusicView: BaseView {
-
- typealias DismissViewClosure = () -> Void
- var dismissViewClosure : DismissViewClosure?
-
- override func setupViews() {
- self.backgroundColor = UIColor.clear
-
- // 添加毛玻璃效果,需使用frame设置位置
- let blurEffect = UIBlurEffect(style: .dark)
- let blurEffectView = UIVisualEffectView(effect: blurEffect)
- blurEffectView.frame = CGRect(x: CGFloat(0), y: kNavBarTotalHeight, width: kScreenWidth, height: kScreenHeight-kNavBarTotalHeight)
- addSubview(blurEffectView)
-
- addSubview(tableView)
- }
-
- override func setupLayouts() {
- tableView.snp.makeConstraints { (make) in
- make.top.equalToSuperview()
- make.left.right.bottom.equalTo(0)
- }
- }
-
- lazy var tableView: UITableView = {
- let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
- tableView.separatorStyle = .none
- tableView.backgroundColor = UIColor.clear
- tableView.dataSource = self
- tableView.delegate = self
- tableView.estimatedRowHeight = 50
- tableView.estimatedSectionFooterHeight = 0.000001
- tableView.estimatedSectionHeaderHeight = 0.000001
- return tableView
- }()
- }
- extension PublishMusicView: UITableViewDataSource, UITableViewDelegate {
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return 5
- }
-
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- return UITableViewCell()
- }
-
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- print("点击了----\(indexPath.row)")
- }
-
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
- return 50
- }
-
- func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
- return 0
- }
-
- }
|