iOS Uicollectionview simple Instructions

Source: Internet
Author: User

Forgive me, I can't remember writing it down.

Uicollectionviewflowlayout flow Automatic layout inherits from Uicollectionviewlayout

Initialize: [[Uicollectionviewflowlayout Alloc]init]

Property Description:

Minimumlinespacing:cell up and down spacing

Minimuminteritemspacing: Left and right spacing

Size of the Itemsize:cell

Scrolldirection: Direction

Sectioninset: The margin of the module

Headerreferencesize:heder size

Footerreferencesize:footer size

Uicollectionview Collection View

Initialize: [[[Uicollectionview alloc]initwithframe:cgrectmake (0, 0, Self.view.frame.size.width, self.view.frame.size.height) Collectionviewlayout:flowlayout];

Register Cell:[_collectionview Registerclass:[collectionviewcell class] forcellwithreuseidentifier:@ "CollectionViewCell" ];

Registernib: (Nullable uinib *) nib Forcellwithreuseidentifier: (NSString *) identifier (XIB)
Register Reusableview:[_collectionview Registerclass:[collectionreusableview class] Forsupplementaryviewofkind: Uicollectionelementkindsectionheader withreuseidentifier:@ "Reusableview"];

Registernib: (Nullable uinib *) nib Forsupplementaryviewofkind: (NSString *) kind withreuseidentifier: (NSString *) Identifier

Common agent: 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;

Recommended: Uicollectionviewleftalignedlayout to align Left

iOS Uicollectionview simple Instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.