Mohammed Hussain
Mohammed Hussain

Reputation: 176

UICollectionView Cell position changing in IPhone6

I'm really stuck on this as I have a CollectionView and it contains 2 rows.The width of One row is equal to width of viewController(320).It is working fine in iphone 4 and Iphone 5s but in Iphone 6 it is looking like this..

enter image description here

The blue one is row one and Red is row two... I had configure the collectionview like this...

 [flowLayout setItemSize:self.bounds.size];

self.collectionView = [[UICollectionView alloc]initWithFrame:self.bounds collectionViewLayout:flowLayout];

so it is self.bounds on every view and it working fine but in Iphone 6s it not fiiting self.bounds why..plz help

Upvotes: 1

Views: 182

Answers (1)

Moin Shirazi
Moin Shirazi

Reputation: 4425

Instead of self.bound you can try out this

CGRect screenRect = [[UIScreen mainScreen] bounds];

Upvotes: 2

Related Questions