创建集合视图UICollectionView*cView=[[UICollectionViewalloc]initWithFrame:CGRectMake(0,0,320,568)collectionViewLayout:flowLayout];cView.dataSource=self;设置dataSource代理cView.delegate=self;设置delegate代理[self.viewaddSubview:cView];集合视图cell的数量-(NSIn..
分类:
其他好文 时间:
2014-09-20 02:24:26
阅读次数:
141
UICollectionViewFlowLayout*flowLayout=[[UICollectionViewFlowLayoutalloc]init];滚动方向:flowLayout.scrollDirection=UICollectionViewScrollDirectionHorizontal;行间距(最小)flowLayout.minimumLineSpacing=0;列间距(最小)flowLayout.minimumInteritemSpacing=30;item大..
分类:
其他好文 时间:
2014-09-20 02:24:17
阅读次数:
173
@interfaceFooterView:UICollectionReusableViewFooter和Header基于UICollectionReusableView重用标识staticNSString*headeridentifier=@"header";staticNSString*footeridentifier=@"FOOTER";注册重用标识符第一个参数:返回的view类型第二个参数:设置view的种类(header,footer..
分类:
其他好文 时间:
2014-09-20 02:24:06
阅读次数:
220
一.UICollectionView使用的cell重用机制
1.首先服从协议,如果自定义cell,导入自定义cell类的头文件
2.定义全局变量重用标识符
static
NSString *cellIdentifier =
@“重用”;
3.注册cell(collection,为UICollectionView对象)
[collection registerClass:[U...
分类:
其他好文 时间:
2014-09-19 13:54:15
阅读次数:
228
创建CollectionCell模版:1、新建类CollectionCell继承自UICollectionViewCell2、新建Xib,命名为CollectionCell.xiba.选中CollectionCell.xib删掉默认的View,从控件中拖一个Collection View Cell(...
分类:
移动开发 时间:
2014-09-19 13:23:45
阅读次数:
268
用CHTCollectionViewWaterfallLayout写瀑布流实现的瀑布流效果图:源码:WaterfallCell.h 与WaterfallCell.m//// WaterfallCell.h// UICollectionView//// Created by YouXianMin...
分类:
其他好文 时间:
2014-09-17 18:21:52
阅读次数:
295
注:这里是iOS6新特征汇总贴链接iOS6新特征:参考资料和示例汇总这个链接可以学习到UICollectionView的相关介绍:iOS6新特征:UICollectionView介绍由于UICollectionView功能比较强大,在此,我们深入学习一下UICollectionView的官方使用示例...
分类:
其他好文 时间:
2014-09-09 17:44:19
阅读次数:
424
//
1) 必须使用下面的方法进行Cell类的注册:
// - (void)registerClass:forCellWithReuseIdentifier:
// - (void)registerClass:forSupplementaryViewOfKind:withReuseIdentifier:
// - (voi...
分类:
移动开发 时间:
2014-09-05 14:24:21
阅读次数:
270
网上的UICollectionView的Layout布局,其cell的形状多为矩形和圆形。
本篇博文将正六边形作为cell的基本形状,为您展现独特的蜂窝布局效果及实现源码。
帮助您让自己的App脱颖而出,更加与众不同。...
分类:
其他好文 时间:
2014-09-02 21:28:15
阅读次数:
342
本文讲述了UITableView、UICollectionView实现self-sizing cell布局的知识,以及如何用InvalidationContext优化UICollectionView布局的更新。背景iOS越来越人性化了,用户可以在设置-通用-辅助功能中动态调整字体大小了。你会发现所有...
分类:
移动开发 时间:
2014-08-24 23:39:03
阅读次数:
597