ios UICollectionView 的用法
2013-09-25 14:16
507 查看
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout
alloc]
init];
// UICollectionViewLayoutAttributes *flowLayout=[[UICollectionViewLayoutAttributes alloc]init];
[flowLayout
setItemSize:CGSizeMake(68,70)];
flowLayout.minimumLineSpacing=1;
flowLayout.minimumInteritemSpacing=1;
[flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
flowLayout.sectionInset =
UIEdgeInsetsMake(0,
0, 0,
0);
_collect=[[UICollectionView
alloc]initWithFrame:CGRectMake(0,
288,
768, 710)
collectionViewLayout:flowLayout];
[_collect
registerClass:[CollectionCell
class] forCellWithReuseIdentifier:@"collectID"];
[_collect
setBackgroundColor:[UIColor
colorWithRed:0.8
green:0.8
blue:0.8
alpha:1]];
_collect.dataSource=self;
[self.view
addSubview:_collect];
alloc]
init];
// UICollectionViewLayoutAttributes *flowLayout=[[UICollectionViewLayoutAttributes alloc]init];
[flowLayout
setItemSize:CGSizeMake(68,70)];
flowLayout.minimumLineSpacing=1;
flowLayout.minimumInteritemSpacing=1;
[flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
flowLayout.sectionInset =
UIEdgeInsetsMake(0,
0, 0,
0);
_collect=[[UICollectionView
alloc]initWithFrame:CGRectMake(0,
288,
768, 710)
collectionViewLayout:flowLayout];
[_collect
registerClass:[CollectionCell
class] forCellWithReuseIdentifier:@"collectID"];
[_collect
setBackgroundColor:[UIColor
colorWithRed:0.8
green:0.8
blue:0.8
alpha:1]];
_collect.dataSource=self;
[self.view
addSubview:_collect];
相关文章推荐
- iOS UICollectionView 高级用法(长按cell移动重新排列)
- iOS求生之路(四)UICollectionView的用法
- iOS UICollectionView高级用法(长按自由移动cell)
- iOS UICollectionView高级用法(长按自由移动cell)-新
- iOS UICollectionView之三(基本用法)
- [IOS开发]新控件,新特性 UICollectionView(2)
- iOS 实现UICollectionView头部悬停效果
- iOS 手写代码UICollectionView
- iOS开发之窥探UICollectionViewController(五) --一款炫酷的图片浏览组件
- iOS - UICollectionView 自定义布局之风火轮[译] (原版为swift,我这里的实现改为OC)
- iOS开发进阶 - 自定义UICollectionViewLayout实现瀑布流布局
- iOS UICollectionViewController基本使用方法和简单的相册实现
- IOS UI-瀑布流(UICollectionView)
- WWDC2016 Session笔记 - iOS 10 UICollectionView新特性
- UICollectionView用法补充(照片轮播墙)
- iOS:UICollectionView实现无限轮播图(Swift3)
- IOS UICollectionView
- iOS之流布局UICollectionView全系列教程
- iOS开发 - UICollectionViewFlowLayout 流水布局
- iOS UICollectionView简单使用