Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Configure layout
- UICollectionViewFlowLayout *flowLayout_D = [[UICollectionViewFlowLayout alloc] init];
- [flowLayout_D setItemSize:CGSizeMake(102, 96)]; //your cell size
- [flowLayout_D setScrollDirection:UICollectionViewScrollDirectionHorizontal];
- [self->mycollectionView setCollectionViewLayout:flowLayout_D];
- #pragma mark Collection view layout things
- - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
- if (collectionView==myCollectionView) {
- return 2.0;
- }
- else
- return 0;
- }
- - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
- if (collectionView==myCollectionView) {
- return 2.0;
- }
- else
- return 0;
- }
- // Layout: Set Edges
- - (UIEdgeInsets)collectionView:
- (UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
- // return UIEdgeInsetsMake(0,8,0,8); // top, left, bottom, right
- if (collectionView==myCollectionView) {
- return UIEdgeInsetsMake(0,0,0,0);
- }// top, left, bottom, right
- else
- return UIEdgeInsetsMake(0,0,0,0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement