UICollectionView is too wide. How can i make it the width of the device?

2 Solutions Collect From Internet About “UICollectionView is too wide. How can i make it the width of the device?”

you need to pinned all edges of your UICollectionview…check out here

enter image description here

By pinned all edges, you’ll get equal height and width of screen

You need to add the proper constraints to your collection view. If you want it to be the width of the screen, then add 0 length spacing constraints to both edges of the controller’s self.view (top and bottom as well if you want it full height).