Commit 9974d023 authored by MJLee's avatar MJLee
Browse files

Modify collectionView demo

Modify collectionView demo
parent 74c7b128
No related merge requests found
Showing with 8 additions and 9 deletions
+8 -9
Pod::Spec.new do |s|
s.name = "MJRefresh"
s.version = "1.3.0"
s.version = "1.3.1"
s.summary = "The easiest way to use pull-to-refresh"
s.homepage = "https://github.com/CoderMJLee/MJRefresh"
s.license = "MIT"
s.authors = { 'MJ Lee' => '199109106@qq.com'}
s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/CoderMJLee/MJRefresh.git", :tag => "1.3.0" }
s.source = { :git => "https://github.com/CoderMJLee/MJRefresh.git", :tag => "1.3.1" }
s.source_files = "MJRefreshExample/MJRefreshExample/MJRefresh/*.{h,m}"
s.resource = "MJRefreshExample/MJRefreshExample/MJRefresh/MJRefresh.bundle"
s.requires_arc = true
......
......@@ -65,6 +65,8 @@ static const CGFloat MJDuration = 2.0;
[weakSelf.collectionView.footer endRefreshing];
});
};
// 默认先隐藏footer
self.collectionView.footer.hidden = YES;
}
#pragma mark - 数据相关
......@@ -72,11 +74,6 @@ static const CGFloat MJDuration = 2.0;
{
if (!_colors) {
self.colors = [NSMutableArray array];
for (int i = 0; i<5; i++) {
// 添加随机色
[self.colors addObject:MJRandomColor];
}
}
return _colors;
}
......@@ -106,15 +103,17 @@ static NSString *const MJCollectionViewCellIdentifier = @"color";
{
[super viewDidLoad];
[self performSelector:NSSelectorFromString(self.method) withObject:nil];
self.collectionView.backgroundColor = [UIColor whiteColor];
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:MJCollectionViewCellIdentifier];
[self performSelector:NSSelectorFromString(self.method) withObject:nil];
}
#pragma mark - collection数据源代理
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
// 设置尾部控件的显示和隐藏
self.collectionView.footer.hidden = self.colors.count == 0;
return self.colors.count;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment