GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rajnish87/DynamicHeightForCollectionView: Simple solution for Dynamically adjust view as a blocks.Dynamically adjust height of collection view. No more White spaces.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
ScreenShots
ScreenShots
 
 
dynamicCollectionView.xcodeproj
dynamicCollectionView.xcodeproj
 
 
dynamicCollectionView
dynamicCollectionView
 
 
License.md
License.md
 
 
README.md
README.md
 
 

Repository files navigation

Platform Language

Dynamic Height For UICollectionView

  • Simple solution for Dynamically adjust view as a blocks.
  • Dynamically adjust height of collection view.
  • No more White spaces

Difference between Normal CollectionView Layout and Custom CollectionView Layout

While using Dynamic height only While using Dynamic height with Custom Layout Made by Me
ScreenShot ScreenShot

How to get Custom CollectionView Layout for your UICollectionView

Add Following Files to your project

  • customLayout.h
  • customLayout.m

Import customLayout in your controller where to use

#import "customLayout.h"

And use

<customLayoutDelegate> 

to your controller.

Write Simple Code in your viewDidLoad Method

    columncount=2; // How much Columns you required
    miniInteriorSpacing=10; // Minimum Spacing you required
    
    if(![collectionView.collectionViewLayout isKindOfClass:[customLayout class]]){
        customLayout *layout = [customLayout new];
        layout.delegate=self;
        layout.columnCount=columncount;
        
        collectionView.collectionViewLayout = layout;
        
        [collectionView reloadData];
    } 

For getting height of Label I have written a method.

-(float)calculateHeightForLbl:(NSString*)text width:(float)width;

About

Simple solution for Dynamically adjust view as a blocks.Dynamically adjust height of collection view. No more White spaces.

Resources

Readme
Apache-2.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.