Need help with MZBookshelfCollectionViewLayout?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

m1entus
129 Stars 19 Forks MIT License 6 Commits 0 Opened issues

Description

Bookshelf like iBooks layout for UICollectionView.

Services available

!
?

Need anything else?

Contributors list

No Data

MZBookshelfCollectionViewLayout

MZBookshelfCollectionViewLayout
is a collection view layout similar to iBooks for UICollectionView.

Interface

extern NSString *const MZBookshelfCollectionViewLayoutDecorationViewKind;

@class MZBookshelfCollectionViewLayout;

@protocol MZBookshelfCollectionViewLayoutDelegate @required

  • (CGSize)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout referenceSizeForDecorationViewForRow:(NSInteger)row inSection:(NSInteger)section;

@optional

  • (UIOffset)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout decorationViewAdjustmentForRow:(NSInteger)row inSection:(NSInteger)section; @end

@interface MZBookshelfCollectionViewLayout : UICollectionViewFlowLayout @end

Example Usage

- (void)viewDidLoad
{
    [super viewDidLoad];

MZBookshelfCollectionViewLayout *layout = (id)self.collectionView.collectionViewLayout;
[layout registerNib:[UINib nibWithNibName:@"MZBookShelfDecorationView" bundle:nil] forDecorationViewOfKind:MZBookshelfCollectionViewLayoutDecorationViewKind];

}

  • (CGSize)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout referenceSizeForDecorationViewForRow:(NSInteger)row inSection:(NSInteger)section { return CGSizeMake(collectionViewLayout.collectionViewContentSize.width, 30); }

  • (UIOffset)collectionView:(UICollectionView *)collectionView layout:(MZBookshelfCollectionViewLayout *)collectionViewLayout decorationViewAdjustmentForRow:(NSInteger)row inSection:(NSInteger)section { return UIOffsetMake(0, 0); }

Contact

Michał Zaborowski

  • http://github.com/m1entus
  • http://twitter.com/iMientus
  • http://twitter.com/inspace_io

License

MZBookshelfCollectionViewLayoutDelegate is available under the MIT license. See the LICENSE file for more info.

Bitdeli Badge

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.