Giter Club home page Giter Club logo

collectionview's Introduction

The Summary of the UICOllectionView

参考网络教程,自己总结而来


 1. Core Layout Process(核心布局的处理过程)
	继承UICollectionViewLayout必须实现如下方法:
		- prepareLayout():
			 布局将要生效在方法里面计算好item的position,collection的size
		- collectionViewContentSize()
			 返回CollectionViewContentSize 不是size(width,height),contentSize一般比size要大 
		- layoutAttributeForElementsInRect()
			 返回特定区域内的布局属性
 2. Calculating Layout Attributes(计算 布局的属性)
 	cell 宽度不变,变高度 ,高度(caption,comment,image.size.height)	

0

* UICollectionViewFlowLayout

eg 1. FlickrSearch

1 2

eg 2. Photomania

3 4

eg 3. UICollectionFlowLayout

5 6

eg 4. UICollectionViewDelegateFlowLayout

7


  1. 基本概念: UICollectionView
    • UICollectionCell
    • Supplementary Views
    • Decoration Views(using custom layout)

Layouts can be swapped out during runtime and the collection view can even automatically animate switching from one layout to another!

  1. UICollectionViewDelegateFlowLayout
    • sizeForItemAtIndexPath -> CGSize
    • insetForSectionAtIndex -> UIEdgeInsets
    • minimumLineSpacingForSectionAtIndex ->CGFloat
    • minimumInteritemSpacingForSectionAtIndex ->CGFloat
    • referenceSizeForHeaderInSection ->CGSize
    • referenceSizeForFooterInSection ->CGSize

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.