您的位置:首页 > 产品设计 > UI/UE

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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: