| | |
| | | |
| | | import UIKit |
| | | import EmptyDataSet_Swift |
| | | import JQTools |
| | | |
| | | class BaseTableView:UITableView{ |
| | | public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_empty"),foregroundColor:UIColor = UIColor.gray.withAlphaComponent(0.5),clouse:((EmptyDataSetView)->Void)? = nil) { |
| | | public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_LOGO")?.jq_imageWithTintColor(color: .gray),foregroundColor:UIColor = UIColor.gray,clouse:((EmptyDataSetView)->Void)? = nil) { |
| | | self.separatorStyle = .none |
| | | self.emptyDataSetView { (emptyDataSetView) in |
| | | emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 16), .foregroundColor:foregroundColor as Any])) |
| | | emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 18,weight: .medium), .foregroundColor:foregroundColor as Any])) |
| | | .image(image) |
| | | .dataSetBackgroundColor(UIColor.white) |
| | | .verticalOffset(0) |
| | |
| | | } |
| | | |
| | | class BaseCollectionView:UICollectionView{ |
| | | public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_empty"),foregroundColor:UIColor = UIColor.gray.withAlphaComponent(0.5),clouse:((EmptyDataSetView)->Void)? = nil) { |
| | | public func jq_setEmptyView( _ noticeStr:String? = nil,image:UIImage? = UIImage(named: "icon_LOGO")?.jq_imageWithTintColor(color: .gray),foregroundColor:UIColor = UIColor.gray,clouse:((EmptyDataSetView)->Void)? = nil) { |
| | | self.emptyDataSetView { (emptyDataSetView) in |
| | | emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 16), .foregroundColor:foregroundColor as Any])) |
| | | emptyDataSetView.titleLabelString(NSAttributedString.init(string: (noticeStr != nil) ? noticeStr! : "暂无数据", attributes: [.font:UIFont.systemFont(ofSize: 18,weight: .medium), .foregroundColor:foregroundColor as Any])) |
| | | .image(image) |
| | | .dataSetBackgroundColor(UIColor.white) |
| | | .verticalOffset(0) |