bryceredd / RFQuiltLayout

A UICollectionViewLayout subclass to put items in a quilting pattern
MIT License
872 stars 130 forks source link

Header #6

Open blackdemon007 opened 11 years ago

blackdemon007 commented 11 years ago

Hi, I use your Layout but if I want show multiple sections with headers, it's not posible, because the header section never get call. What I need to do to show multiple sections and headers??

Thanks iun advance

johndpope commented 11 years ago

+1 vote for sections. Nice work Bryce.

paventuri commented 11 years ago

+1 vote for sections

That would be great to have sections in this control.

Excellent job btw

johndpope commented 11 years ago

I got the sections working by bundling up separate quilts into MMHorizontalListViewCells.

https://github.com/jdp-global/MMHorizontalListView

This sits inline with Windows 8 - Visual Language - hubs / sections - whereby any hub(MMHorizontalListViewCell) could contain any content / picture / form etc.

Todo the titles I just offset uilabel

photo 30

MMHorizontalListView *horizontalView = [[MMHorizontalListView alloc]initWithFrame:self.view.bounds];
horizontalView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
[self.view addSubview:horizontalView];
horizontalView.dataSource = self;
horizontalView.delegate = self;
horizontalView.cellSpacing = 40;
[container0 addSubview:horizontalView];
[self.view addSubview:container0];

flowLayout = [[RFQuiltLayout alloc] init];
flowLayout.tag = 111;
flowLayout.groupSize = CGSizeMake(4,4);
flowLayout.blockPixels = CGSizeMake(122, 122);
flowLayout.direction = UICollectionViewScrollDirectionHorizontal;
flowLayout.delegate = self;

myCollectionView =[[UICollectionView alloc]initWithFrame:rect collectionViewLayout:flowLayout];

// myCollectionView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; [myCollectionView registerClass:[ProfileCell class] forCellWithReuseIdentifier:@"ProfileCell"]; [myCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"ID"]; // Do any additional setup after loading the view, typically from a nib. myCollectionView.delegate = self; myCollectionView.dataSource = self; [myCollectionView setBounces:YES]; myCollectionView.scrollEnabled = NO; myCollectionView.tag = HUB0; [myCollectionView setCollectionViewLayout:flowLayout]; [myCollectionView setBackgroundColor:[UIColor clearColor]];

dinarajas commented 11 years ago

+1 vote for sections. Sections would be highest priority.. This is a great library.

takhand commented 10 years ago

jdp-global can you post your implementation of how you used MMHorizontalListView with QuilViewLayout. Please!!!! Thank you.

wilmarvh commented 10 years ago

+1 for headers / sections

hilen commented 10 years ago

+1 for headers / sections / footers

atsushisakai-gh commented 10 years ago

+1 for headers / sections / footers

steve21124 commented 10 years ago

+1 for headers / sections / footers

antoinelamy commented 10 years ago

I added basic support for it, check my fork at https://github.com/antoinelamy/RFQuiltLayout

smilesworld116 commented 10 years ago

Definitely needs to add a support of sections.

abraxascorner commented 10 years ago

+1. :)

axmav commented 8 years ago

+1

Arnold134777 commented 8 years ago

@antoinelamy when i have tried headerReferenceSize = CGSizeMake(320,222); run ,it show error;

Arnold134777 commented 8 years ago

@antoinelamy I don't know is it right to change

  int unrestrictedDimensionStart = isVert? rect.origin.y / self.itemBlockSize.height : rect.origin.x / self.itemBlockSize.width;

to,I have tried it will be show ok when headerReferenceSize.height > self.itemBlockSize.height.

  int unrestrictedDimensionStart = isVert? (rect.origin.y - self.headerReferenceSize.height) / self.itemBlockSize.height : rect.origin.x / self.itemBlockSize.width;