原谅我记不住写下来好了

UICollectionViewFlowLayout 流式自动布局 继承于UICollectionViewLayout

初始化:[[UICollectionViewFlowLayout alloc]init]

属性说明:

  minimumLineSpacing:cell上下间距

  minimumInteritemSpacing:左右间距

  itemSize:cell的size

  scrollDirection:方向

  sectionInset:模块的边距

  headerReferenceSize:heder尺寸

  footerReferenceSize:footer尺寸

UICollectionView 集合视图

初始化:[[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) collectionViewLayout:flowLayout];

注册cell:[_collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:@"CollectionViewCell"];

     registerNib:(nullable UINib *)nib forCellWithReuseIdentifier:(NSString *)identifier(xib)
注册reusableView:[_collectionView registerClass:[CollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"reusableView"];

          registerNib:(nullable UINib *)nib forSupplementaryViewOfKind:(NSString *)kind withReuseIdentifier:(NSString *)identifier;

常用代理:UICollectionViewDataSource

       - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section;

     - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;

       - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView;

       - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;

      UICollectionViewDelegate

     - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath

     UICollectionViewDelegateFlowLayout

     - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;

 推荐:UICollectionViewLeftAlignedLayout 使其左对齐

ios UICollectionView简单说明的更多相关文章

  1. iOS UICollectionView简单使用

    UICollectionView 和 UICollectionViewController 类是iOS6 新引进的API,用于展示集合视图,布局更加灵活,可实现多列布局,用法类似于UITableVie ...

  2. iOS上简单推送通知(Push Notification)的实现

    iOS上简单推送通知(Push Notification)的实现 根据这篇很好的教程(http://www.raywenderlich.com/3443/apple-push-notification ...

  3. iOS CAReplicatorLayer 简单动画

    代码地址如下:http://www.demodashi.com/demo/11601.html 写在最前面,最近在看学习的时候,偶然间发现一个没有用过的Layer,于是抽空研究了下,本来应该能提前记录 ...

  4. iOS之简单瀑布流的实现

    iOS之简单瀑布流的实现   前言 超简单的瀑布流实现,这里说一下笔者的思路,详细代码在这里. 实现思路 collectionView能实现各中吊炸天的布局,其精髓就在于UICollectionVie ...

  5. IOS基金会_ UICollectionView简单易用

    和表格视图类似 UICollectionView的使用有两种方法 一种是继承UICollectionViewController,这个Controller会自带一个UICollectionView. ...

  6. iOS UICollectionView(转三)

    上篇博客的实例是自带的UICollectionViewDelegateFlowLayout布局基础上来做的Demo, 详情请看<iOS开发之窥探UICollectionViewControlle ...

  7. iOS UICollectionView(转一) XIB+纯代码创建:cell,头脚视图 cell间距

    之前用CollectionViewController只是皮毛,一些iOS从入门到精通的书上也是泛泛而谈.这几天好好的搞了搞苹果的开发文档上CollectionViewController的内容,亲身 ...

  8. [iOS] UICollectionView初始化滚动到中间的bug

    转载请保留地址wossoneri.com 问题 首先看一下我之前写的demo:link demo是封装了一个控件,直接在MainViewController的viewWillAppear里初始化,并且 ...

  9. iOS,手势识别简单使用

    1.iOS目前支持的手势识别(6种) 2.点按手势和慢速拖动手势简单使用 iOS目前支持的手势识别(6种) UITapGestureRecognizer(点按) UIPinchGestureRecog ...

随机推荐

  1. 禁止Linux系统被 ping

    echo "net.ipv4.icmp_echo_ignore_all=1" >> /etc/sysctl.conf sysctl -p 生效 开启ping功能: 删除 ...

  2. 关于IAR开发STM32配置

    因为自己要学Msp430还有ZigBee发现IAR真的挺好用,,,所以以后想着就用IAR写单片机程序,, 这次配置我不会把程序的配置弄得有条理,分开文件夹存放,,,我要把那些文件全都放到一块,,弄得乱 ...

  3. 1734: [Usaco2005 feb]Aggressive cows 愤怒的牛

    1734: [Usaco2005 feb]Aggressive cows 愤怒的牛 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 217  Solved: ...

  4. Java设计模式之《调停者模式》及应用场景

    原创作品,可以转载,但是请标注出处地址:http://www.cnblogs.com/V1haoge/p/6518603.html 调停者模式. 我们想象一下这样的场景:一个系统内部通过许多的类互相之 ...

  5. IO 模型

    常见的IO模型有四种: (1)同步阻塞IO(Blocking IO):即传统的IO模型. (2)同步非阻塞IO(Non-blocking IO):默认创建的socket都是阻塞的,非阻塞IO要求soc ...

  6. SQL server 数据库(视图、事物、分离附加、备份还原))

    ql Server系列:视图.事物.备份还原.分离附加  视图是数据库中的一种虚拟表,与真实的表一样,视图包含一系列带有名称的行和列数据.行和列数据用来自定义视图的查询所引用的表,并且在引用视图时动态 ...

  7. Octave Tutorial(《Machine Learning》)之第一课《数据表示和存储》

    Octave Tutorial 第一课 Computation&Operation 数据表示和存储 1.简单的四则运算,布尔运算,赋值运算(a && b,a || b,xor( ...

  8. Thread.join()的使用

    代码清单: package com.baidu.nuomi.concurrent; import java.util.concurrent.TimeUnit; /** * Created by son ...

  9. 解锁redis锁的正确姿势

    解锁redis锁的正确姿势 redis是php的好朋友,在php写业务过程中,有时候会使用到锁的概念,同时只能有一个人可以操作某个行为.这个时候我们就要用到锁.锁的方式有好几种,php不能在内存中用锁 ...

  10. 【树莓派】制作树莓派最小镜像:img裁剪瘦身

    制作树莓派镜像,可以参考这篇文章:http://blog.csdn.net/talkxin/article/details/50456282 摘录部分要点内容如下(如果作者不允许转载,请联系即删除): ...