VLCFullWidthCollectionViewFlowLayout.m 870 B

12345678910111213141516171819202122232425262728
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Tobias Conradi <videolan # tobias-conradi.de>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "VLCFullWidthCollectionViewFlowLayout.h"
  12. @implementation VLCFullWidthCollectionViewFlowLayout
  13. - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds
  14. {
  15. return YES;
  16. }
  17. - (void)prepareLayout
  18. {
  19. CGSize itemSize = self.itemSize;
  20. itemSize.width = CGRectGetWidth(self.collectionView.bounds)-self.sectionInset.left-self.sectionInset.right;
  21. self.itemSize = itemSize;
  22. [super prepareLayout];
  23. }
  24. @end