All Projects → Ethan561 → HDEmptyView

Ethan561 / HDEmptyView

Licence: other
一个Swift语言封装的EmptyView显示库,可作用于WKWebView、UITableView、UICollectionView 无网络提醒或者空数据提醒

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to HDEmptyView

Hgplaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
Stars: ✭ 2,048 (+6962.07%)
Mutual labels:  uitableview, uicollectionview, empty
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+2344.83%)
Mutual labels:  uitableview, uicollectionview, wkwebview
Basecomponents
BaseComponents aims to provide easily reusable and understandable components to increase productivity with UIKit and Foundation APIs
Stars: ✭ 92 (+217.24%)
Mutual labels:  uitableview, uicollectionview
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+37155.17%)
Mutual labels:  uitableview, uicollectionview
Genericdatasource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
Stars: ✭ 127 (+337.93%)
Mutual labels:  uitableview, uicollectionview
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (+3293.1%)
Mutual labels:  uitableview, uicollectionview
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+3451.72%)
Mutual labels:  uitableview, uicollectionview
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (+737.93%)
Mutual labels:  uitableview, uicollectionview
Viewanimator
ViewAnimator brings your UI to life with just one line
Stars: ✭ 6,592 (+22631.03%)
Mutual labels:  uitableview, uicollectionview
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (+465.52%)
Mutual labels:  uitableview, uicollectionview
Cyanic
Declarative, state-driven UI framework
Stars: ✭ 32 (+10.34%)
Mutual labels:  uitableview, uicollectionview
IQListKit
Model driven UITableView/UICollectionView
Stars: ✭ 51 (+75.86%)
Mutual labels:  uitableview, uicollectionview
Thinningcoordinator
The UITableView/UICollectionView dataSource/delegate thinning coordinator, help thinning your UIViewController!
Stars: ✭ 25 (-13.79%)
Mutual labels:  uitableview, uicollectionview
Carbon
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.
Stars: ✭ 1,034 (+3465.52%)
Mutual labels:  uitableview, uicollectionview
Changeset
Minimal edits from one collection to another
Stars: ✭ 807 (+2682.76%)
Mutual labels:  uitableview, uicollectionview
Gskstretchyheaderview
A generic stretchy header for UITableView and UICollectionView
Stars: ✭ 1,624 (+5500%)
Mutual labels:  uitableview, uicollectionview
Flowkit
A declarative type-safe framework for building fast and flexible list with Tables & Collection
Stars: ✭ 215 (+641.38%)
Mutual labels:  uitableview, uicollectionview
Flix
iOS reusable form library in Swift.
Stars: ✭ 725 (+2400%)
Mutual labels:  uitableview, uicollectionview
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+5831.03%)
Mutual labels:  uitableview, uicollectionview
Rglistkit
RGListKit is a Protocol & MVVM based framework to easily populate a UITableView or UICollectionView via single api.
Stars: ✭ 178 (+513.79%)
Mutual labels:  uitableview, uicollectionview

HDEmptyView

一个Swift语言封装的EmptyView显示库,可作用于WKWebView、UITableView、UICollectionView

示例

  • WKWebView WKWebView
  • UITableView UITableView
  • UICollectionView UICollectionView

要求

  • iOS 9.0+
  • Xcode 9.0+
  • Swift4 (HDEmptyView 4.x)

使用方法

1、创建 HDEmptyView 界面显示对象

//创建方式一:Block回调
let emptyV:HDEmptyView = HDEmptyView.emptyActionViewWithImageStr(imageStr: "net_error_tip", titleStr: "暂无数据,点击重新加载", detailStr: "", btnTitleStr: "点击刷新") {
print("点击刷新")
weakSelf?.reloadDataWithCount(count: 4)
}

//创建方式二:target/action
let emptyV:HDEmptyView = HDEmptyView.emptyActionViewWithImageStr(imageStr: "net_error_tip", titleStr: "暂无数据,点击重新加载", detailStr: "", btnTitleStr: "点击刷新", target: self, action: #selector(reloadBtnAction)) as! HDEmptyView

2、设置显示参数属性

emptyV.titleLabTextColor = UIColor.red
emptyV.actionBtnFont = UIFont.systemFont(ofSize: 19)
emptyV.contentViewOffset = -50
emptyV.actionBtnBackGroundColor = .white
emptyV.actionBtnBorderWidth = 0.7
emptyV.actionBtnBorderColor = UIColor.gray
emptyV.actionBtnCornerRadius = 10

3、赋值给当前显示对象的ly_emptyView

webView.scrollView.ly_emptyView = emptyV

tableView.ly_emptyView = emptyV

collectionView.ly_emptyView = emptyV

//设置点击空白区域是否有刷新操作
self.webView.scrollView.ly_emptyView?.tapContentViewBlock = {
//weakSelf!.loadingURL(urltring: "http://news.baidu.com/")
}


4、自定义空数据界面显示

//自定义空数据界面显示
func setupMyEmptyView() {
let emptyView: MyEmptyView = Bundle.main.loadNibNamed("MyEmptyView", owner: self, options: nil)?.last as! MyEmptyView
emptyView.reloadBtn.addTarget(self, action: #selector(reloadBtnAction(_:)), for: UIControlEvents.touchUpInside)
emptyView.frame = view.bounds
//空数据界面显示
let emptyV:HDEmptyView = HDEmptyView.emptyViewWithCustomView(customView: emptyView) as! HDEmptyView
tableView.ly_emptyView = emptyV
tableView.ly_emptyView?.tapContentViewBlock = {
print("点击界面空白区域")
}
tableView.ly_showEmptyView()
}

注意事项:是否自动显隐EmptyView的参数 autoShowEmptyView 默认设置是true,列表视图会根据界面cell的count数量自动显隐空界面。当设置成false时只能手动调用 ly_showEmptyView() 和 ly_hideEmptyView() 方法进行显隐操作

简书详细介绍地址

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].