Help With Collection View

Hello!

I’m wondering if anyone can help me out with my layout? I am trying to create an interface similar to the netflix interface where you can horizontally scroll a category and also scroll up and down to see the various categories.

I keep getting a message stating:

019-06-16 05:59:30.371217-0700 Quote2[1318:91961] The behavior of the UICollectionViewFlowLayout is not defined because:
2019-06-16 05:59:30.371378-0700 Quote2[1318:91961] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
2019-06-16 05:59:30.371927-0700 Quote2[1318:91961] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fdb49d21dd0>, and it is attached to <UICollectionView: 0x7fdb4a83f800; frame = (0 0; 414 896); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x6000008f3630>; layer = <CALayer: 0x6000006f4200>; contentOffset: {0, -88}; contentSize: {375, 20}; adjustedContentInset: {88, 0, 83, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7fdb49d21dd0>.
2019-06-16 05:59:30.372050-0700 Quote2[1318:91961] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

I have a collection view embedded in a collection view:

And I’m just lost as how to figure out how to resolve this error message. I’m not sure how to get the width and set it appropriately.

Any help appreciated! Thanks!

@monica Do you still have issues with this?

Hi @monica you need to share your code for anyone to help you as this message is not enough to determine where the problem is.

cheers,

I ended up deleting my constraints and recreating them. The error went away. Although, I don’t know which constraint was causing the error. I guess one of the recreated constraints is slightly different from the first one?

This topic was automatically closed after 166 days. New replies are no longer allowed.