프로젝트
GitHub에서 보기
vvusu/LNRefresh
소개
JD.com, Tmall, Taobao, Koala, Meituan, Toutiao, Fliggy의 다양한 애니메이션을 모은 경량 풀투리프레시 컨트롤입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Demo - Installation - Documents - Contribution
LNRefresh
LNRefresh Is a lightweight, can dynamically expand the drop-down refresh component
Support what kinds of controls to refresh
UIScrollView、UITableView、UICollectionView、UIWebView、UITextView
Demo
GIF picture from 华尔街见闻
| Style | Demo |
|---|---|
| Usually style | ![]() |
| Dynamically change the style | ![]() |
Customize Demos
| APP | Demo |
|---|---|
| 京东 | ![]() |
| 天猫 | ![]() |
| 淘宝 | ![]() |
| 考拉海购 | ![]() |
| 美团外卖 | ![]() |
| 网易新闻 | ![]() |
| 今日头条 | ![]() |
| 飞猪 | ![]() |
Installation
CocoaPods
Installation with CocoaPods:
pod 'LNRefresh'
Carthage
Installation with Cartfile:
github "wszoo/LNRefresh"
Documents
How to use LNRefresh
Add pull to refresh
__weak typeof (self) wself = self;
//UITableView
[self.tableView addPullToRefresh:^{
[wself pullToRefresh];
}];
//UICollectionView
[self.collectionView addPullToRefresh:^{
[wself pullToRefresh];
}];
//UIWebView
[self.webView.scrollView addPullToRefresh:^{
[wself.webView reload];
}];
End Pull to refresh
//UITableView
[self.tableView endRefreshing];
//UICollectionView
[self.collectionView endRefreshing];
//UIWebView
[self.webView.scrollView endRefreshing];
Add Loading more
//UITableView
[self.tableView addInfiniteScrolling:^{
[wself loadMoreRefresh];
}];
//UICollectionView
[self.collectionView addInfiniteScrolling:^{
[wself loadMoreRefresh];
}];
End Loading more
//UITableView
[self.tableView endLoadingMore];
//UICollectionView
[self.tableView endLoadingMore];
No More data
//UITableView
[self.tableView noticeNoMoreData];
//UICollectionView
[self.tableView noticeNoMoreData];
Auto Refresh
[self.scrollView startRefreshing];
Change the trigger to pull the refresh distance
self.tableView.ln_header.animator.trigger = 100;
Global Settings
Set the GIF image
+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
state:(LNRefreshState)state;
+ (void)setAllHeaderAnimatorStateImages:(NSArray *)stateImages
state:(LNRefreshState)state
duration:(NSTimeInterval)duration;
Change the global pull-down refresh pattern state
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type;
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
bgImage:(UIImage *)image;
+ (void)changeAllHeaderAnimatorType:(LNRefreshHeaderType)type
bgImage:(UIImage *)image
incremental:(CGFloat)incremental;
Customize RefreshAnimator
You Need to inherit LNHeaderAnimator,Rewrite the following method.
- (void)setupHeaderView_DIY;
- (void)layoutHeaderView_DIY;
- (void)refreshHeaderView_DIY:(LNRefreshState)state;
- (void)refreshView_DIY:(LNRefreshComponent *)view progress:(CGFloat)progress;
Example: LNHeaderDIYAnimator.m
Analysis
Example: LNHeaderAnimator+Analysis.m
Contribution
License
Copyright (c) 2017 vvusu
관련 프로젝트 살펴보기
불러오는 중…









