代码拉取完成,页面将自动刷新
A prototype cell in storyboard
-registerNib:forCellReuseIdentifier:
-registerClass:forCellReuseIdentifier:
if your cell use autolayout , all you need just to do like this:
#import "UICollectionView+ARDynamicHeightLayoutCell.h"
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" fixedWidth:300 configuration:^(id cell) {
//configuration your cell
FeedModel *feed = self.feeds[indexPath.row];
[cell filleCellWithFeed:feed];
}];
}
#import "UICollectionView+ARDynamicHeightLayoutCell.h"
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" fixedHeight:400 configuration:^(id cell) {
//configuration your cell
FeedModel *feed = self.feeds[indexPath.row];
[cell filleCellWithFeed:feed];
}
}
#import "UICollectionView+ARDynamicHeightLayoutCell.h"
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [collectionView ar_sizeForCellWithIdentifier:@"DynamicHeightCell" configuration:^(id cell) {
//configuration your cell
FeedModel *feed = self.feeds[indexPath.row];
[cell filleCellWithFeed:feed];
}
}
pod 'UICollectionView-ARDynamicHeightLayoutCell', :git => 'https://github.com/AugustRush/UICollectionView-ARDynamicHeightLayoutCell.git'
v1.0
add cache for cell size height, improve efficiency(automatic invalidate)
v0.7
add Support for StoryBoard prototype cell
v0.6
fixed Height caculated bug and support Dynamic size cell
v0.5
support to caculate size for UICollectionView Cell
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。