Wednesday, October 28, 2026
HomeiOS Developmentios - Increase UICollectionViewCell to suit to width of a nested UIConnectionView

ios – Increase UICollectionViewCell to suit to width of a nested UIConnectionView

[ad_1]

I’ve a UICollectionViewCell that I need to increase when tapped. The cell is only a header that then expands right into a smaller UICollectionView. The outer UICollectionViewCell is laid out by way of AutoLayout (in a UIStackView, though I am not married to that concept if it is an issue).

E.g.

[ -------NFL------- ] -> (That is an unexpanded cell)
| -------NBA------- | -> (That is an expanded cell)
| [Nets Vs. Celtics]| -> (These are cells of a set view that is contained in the expanded cell)
| [Hawks Vs. Heat]  | 

In order you may see, when you faucet a header, it expands and exhibits the entire present video games in that given league.

The issue is {that a} UICollectionViewCell wants specified dimensions. I do know what the width must be (simply the secure space format width), however I can not seem to get it to grasp that I need the peak to be versatile. I feel the explanation that it is a drawback is that since I am nesting one collectionview within one other, the outer collectionview cannot decide its intrinsic content material measurement.

Any concepts / workarounds right here? The rationale that I am utilizing a set view for the leagues (the outer assortment view) is as a result of I do not essentially know beforehand which leagues will seem (i.e. they will solely seem if there are lively video games.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments