You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

52 lines
1.6 KiB

//
// UITableView+Extensions.swift
// Lookfit
//
// Created by lemo on 2018/6/3.
// Copyright © 2020 ecell. All rights reserved.
//
import Foundation
extension UITableView {
/// grouped15.0
func groupedDefaultHeaderAndFooterHeight() {
self.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: kScaleHeight(10.0)))
self.sectionHeaderHeight = kScaleHeight(15.0)
self.sectionFooterHeight = kScaleHeight(0.01)
}
/// grouped015.0
func groupedDefaultHeaderZero() {
self.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0.01))
self.sectionHeaderHeight = kScaleHeight(15.0)
self.sectionFooterHeight = kScaleHeight(0.01)
}
/// plain10.0cell
func plainDefaultHeaderAndHideCell() {
self.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: kScaleHeight(10.0)))
self.tableFooterView = UIView()
}
/// cell
func hideCell() {
self.tableFooterView = UIView()
}
///
func noDataHandle(count: Int, tip: String?, type: NoDataType) {
if count > 0 {
tableFooterView = UIView()
return
}
tableFooterView = NoDataView(frame: CGRect(x: 0, y: 0, width: width, height: height), tip: tip, type: type)
}
///
func setDefultColor() {
self.backgroundColor = kHexColor(0xC5D0DB, 0.2)
}
}