All Projects → Mindinventory → Bubblecollectionviewlayout

Mindinventory / Bubblecollectionviewlayout

Licence: mit
Create bubble layout of UICollectionView using custom layout

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Bubblecollectionviewlayout

Wslwaterflowlayout
功能描述:WSLWaterFlowLayout 是在继承于UICollectionViewLayout的基础上封装的控件, 目前支持竖向瀑布流(item等宽不等高、支持头脚视图)、水平瀑布流(item等高不等宽 不支持头脚视图)、竖向瀑布流( item等高不等宽、支持头脚视图)、栅格布局瀑布流 4种样式的瀑布流布局。
Stars: ✭ 308 (+289.87%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Chtcollectionviewwaterfalllayout
The waterfall (i.e., Pinterest-like) layout for UICollectionView.
Stars: ✭ 4,288 (+5327.85%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Bouncylayout
Make. It. Bounce.
Stars: ✭ 4,035 (+5007.59%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+1203.8%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Collectionviewpaginglayout
a simple but highly customizable paging layout for UICollectionView.
Stars: ✭ 947 (+1098.73%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Uicollectionviewflexlayout
A drop-in replacement for UICollectionViewFlowLayout
Stars: ✭ 277 (+250.63%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Collectionkit
Reimagining UICollectionView
Stars: ✭ 4,153 (+5156.96%)
Mutual labels:  uicollectionviewlayout, uicollectionview
ScaledCenterCarousel
A carousel-based layout for UICollectionView with scaled center item.
Stars: ✭ 16 (-79.75%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Centeredcollectionview
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift
Stars: ✭ 965 (+1121.52%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Swiftspreadsheet
Spreadsheet CollectionViewLayout in Swift. Fully customizable. 🔶
Stars: ✭ 590 (+646.84%)
Mutual labels:  uicollectionviewlayout, uicollectionview
iOSEasyList
A data-driven UICollectionView and UITableView framework for building fast and flexible lists
Stars: ✭ 29 (-63.29%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Drcollectionviewtablelayout Ios
UICollectionView 2d-table / grid / spreadsheet layout
Stars: ✭ 74 (-6.33%)
Mutual labels:  uicollectionviewlayout, uicollectionview
ScrollAnimationShowcase
[ING] - UIScrollViewやUICollectionViewの特性を活用した表現サンプル
Stars: ✭ 15 (-81.01%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Swiftdatatables
A Swift Data Table package, display grid-like data sets in a nicely formatted table for iOS. Subclassing UICollectionView that allows ordering, and searching with extensible options.
Stars: ✭ 287 (+263.29%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Transfiguration
Mystical way to transform data into reusable view in Swift
Stars: ✭ 14 (-82.28%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Uicollectionview Layouts Kit
📐 A set of custom layouts for UICollectionView with examples [Swift 5.3, iOS 12].
Stars: ✭ 410 (+418.99%)
Mutual labels:  uicollectionviewlayout, uicollectionview
CollectionLayouts
A collection of UICollectionViewLayouts
Stars: ✭ 64 (-18.99%)
Mutual labels:  uicollectionview, uicollectionviewlayout
HorizontalStickyHeaderLayout
Horizontal UICollectionViewLayout with Sticky HeaderView
Stars: ✭ 70 (-11.39%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Carlenscollectionviewlayout
An easy-to-use Collection View Layout for card-like animation.
Stars: ✭ 478 (+505.06%)
Mutual labels:  uicollectionviewlayout, uicollectionview
Alignedcollectionviewflowlayout
A collection view layout that gives you control over the horizontal and vertical alignment of the cells.
Stars: ✭ 751 (+850.63%)
Mutual labels:  uicollectionviewlayout, uicollectionview

BubbleCollectionViewLayout

Used to get layout like following screens in UICollectionView using custom layout.

bubble_portrait

bubble_landscape

Requirements

Minimum OS 8.1 and later

Manual Installation

You can directly add Below the source files from Class folder to your project.

Objective C

  1. MIBubbleCollectionViewCell.h
  2. MIBubbleCollectionViewCell.m
  3. MICollectionViewBubbleLayout.h
  4. MICollectionViewBubbleLayout.m

Swift

  1. MIBubbleCollectionViewCell.swift
  2. MICollectionViewBubbleLayout.swift

Introduce

MICollectionViewBubbleLayout is subclass of UICollectionViewFlowLayout with the custom layout.

Usage

The easy way is to use UICollectionViewFlowLayout as it is. You can also subclass it if you intend to change the default behaviour.

Here is the instruction of how to use UICollectionViewFlowLayout in the Storyboard.

  1. Add native UICollectionView to the storyboard, establish relationships with its view controllers.
  2. Add UICollectionViewCell in the UICollectionView to the storyboard. 3)Chose the MIBubbleCollectionViewCell as a custom class inside the UICollectionViewCell to the storyboard. Configuration for change DefaultInterItemSpacing & DefaultLineSpacing of collecttionview cell you just have to change the value of below two constant in MICollectionViewBubbleLayout.h

#define kDefaultInterItemSpacing 5.0f

#define kDefaultLineSpacing 5.0f

Objective C -

  1. Add "MICollectionViewBubbleLayout" ObjectiveC files to your project.

  2. Conform delegate "MICollectionViewBubbleLayoutDelegate" to your class.

  3. Set bubble layout in collectionview.

     MICollectionViewBubbleLayout *layout = [[MICollectionViewBubbleLayout alloc] initWithDelegate:self];
     [layout setMinimumLineSpacing:6.0f];
     [layout setMinimumInteritemSpacing:6.0f];
     [collVData setCollectionViewLayout:layout];
    
  4. Implement MICollectionViewBubbleLayoutDelegate method to return size according to your text content.

     - (CGSize)collectionView:(UICollectionView *)collectionView itemSizeAtIndexPath:(NSIndexPath *)indexPath {
    
         NSString *title = arrData[indexPath.row];
         CGSize size = [title sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"HelveticaNeue-Bold" size:15]}];
         size.width = ceilf(size.width + CTitlePadding * 2);
         size.height = 24;
    
         //...Checking if item width is greater than collection view width then set item width == collection view width.
         if (size.width > collectionView.frame.size.width)
             size.width = collectionView.frame.size.width;
          return size;
     }
    

Swift -

  1. Add "MICollectionViewBubbleLayout" Swift file to your project.

  2. Conform delegate "MICollectionViewBubbleLayoutDelegate" to your class.

  3. Set bubble layout in collectionview.

     let bubbleLayout = MICollectionViewBubbleLayout()
     bubbleLayout.minimumLineSpacing = 6.0
     bubbleLayout.minimumInteritemSpacing = 6.0
     bubbleLayout.delegate = self 
     collVData.setCollectionViewLayout(bubbleLayout, animated: false)
    
  4. Implement MICollectionViewBubbleLayoutDelegate method to return size according to your text content.

     func collectionView(_ collectionView:UICollectionView, itemSizeAt indexPath:NSIndexPath) -> CGSize
     {
         let title = arrData![indexPath.row] as! NSString
         var size = title.size(withAttributes: [NSAttributedStringKey.font: UIFont(name: "HelveticaNeue-Bold", size: 15)!])
         size.width = CGFloat(ceilf(Float(size.width + CGFloat(kItemPadding * 2))))
         size.height = 24
     
         //...Checking if item width is greater than collection view width then set item width == collection view width.
         if size.width > collectionView.frame.size.width {
             size.width = collectionView.frame.size.width
         }
     
         return size;
     }
    

LICENSE!

BubbleCollectionViewLayout is MIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding our work.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].