Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. // Configure layout
  2. UICollectionViewFlowLayout *flowLayout_D = [[UICollectionViewFlowLayout alloc] init];
  3. [flowLayout_D setItemSize:CGSizeMake(102, 96)]; //your cell size
  4. [flowLayout_D setScrollDirection:UICollectionViewScrollDirectionHorizontal];
  5. [self->mycollectionView setCollectionViewLayout:flowLayout_D];
  6.  
  7. #pragma mark Collection view layout things
  8.  
  9. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
  10. if (collectionView==myCollectionView) {
  11. return 2.0;
  12. }
  13. else
  14. return 0;
  15. }
  16.  
  17. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
  18. if (collectionView==myCollectionView) {
  19. return 2.0;
  20. }
  21. else
  22. return 0;
  23. }
  24.  
  25. // Layout: Set Edges
  26. - (UIEdgeInsets)collectionView:
  27. (UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
  28. // return UIEdgeInsetsMake(0,8,0,8); // top, left, bottom, right
  29. if (collectionView==myCollectionView) {
  30. return UIEdgeInsetsMake(0,0,0,0);
  31. }// top, left, bottom, right
  32. else
  33. return UIEdgeInsetsMake(0,0,0,0);
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement