Check Mobile App
Read now
Start a Project

How to make dynamic height of a UICollectionView which inside any UI component?

Save

Most of the time we are facing issues on the dynamic height of the UICollectionView which inside any UI component (like TableView, View). Today I will show you how to manage a UICollectionView height inside the UITableView.

UITableView is mostly used for showing dynamic layout or collections. Sometimes we have to use UICollectionView inside the TableViewCell and also manage height according to the contents. This section, I am going manage CollectionView an easy way

Let’s start the implementation part.

 

Step 1: Add a UITableView inside the UIViewController.

 

Step 2: Configure a UITableViewCell with UICollectionView

Step 3: Now Create a SubClass of the UICollectionView and Set this CustomCollectionView class in UIcollectionView.

The above code will invalidate the intrinsicContentSize and will use the actual contentSize of collectionView. The above code takes into consideration the custom layout as well.

Step 4: Update the UICollectionView layout after reloading the CollectionView.

I hope this post will help you to manage the Dynamic height of a UICollectionView.

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

Michael Urresta

Michael Urresta

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home