简体   繁体   中英

Why CollectionView cell insider other collectionView has wrong size?

I have a collectionView (nested) inside a collectionViewCell. When I open this VC, the cell inside nested collectionView have wrong size. After scroll down and up - everything is fine. I think when I am scrolling method layoutSubviews are calling. But when I added cell.setNeedsLayout() cell.layoutIfNeeded() inside func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) the result is not change.
在此处输入图像描述

在此处输入图像描述

Constraints: 在此处输入图像描述

i think problem is not with the size, it is from constraints.

Would you please share a snippet of your code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM