Hi,

I'm trying to create a 3 cell per row collection, and I want no margin
(horizontally or vertically) between each cell.

So in xcode I set Min Spacing For Cells / For Lines to 1, Indicator
insets (all 4 values) to 0, then I write code like this:

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

    return 9;

}


- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView

{

    return 1;

}


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



    CollectionCell *cell = [collectionView
dequeueReusableCellWithReuseIdentifier:@"Cell"
forIndexPath:indexPath];



    [cell setFrame: CGRectMake (cell.frame.origin.x,

                                cell.frame.origin.y,

                                self.collectionView.frame.size.width / 3,

                                cell.frame.size.height)];



    cell.backgroundColor = [UIColor whiteColor];

    return cell;

}

If you run that code you will see the horizontal margin still exists
and is very huge compared to the vertical one.

What's the correct way to do it?


-- 
Best Regards,
Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/
Finger Print:   9F67 391B B770 8FF6 99DC  D92D 87F6 2602 1371 4D33
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to