0

I am like to know is there any possibility to increase and decrease the width and height of UI objects.

enter image description here

1.Took this image as example ,This is collection view designed for iphone 6.

2.while build the project image occupy two in a row.

3.while i run this for iphone5,iphone4s only one image can occupy the row.

4.so i like to know is there any way to achieve image should place for each phone should have two image inside the collection cell.

5.I have tried to set constraint for collection cell but later i understood no possible.

Kishore Kumar
  • 4,265
  • 3
  • 26
  • 47

2 Answers2

1

It looks like Constraint Problem there ,

Give Top, Bottom , Leading , Trailing constraint to image view

DO NOT Fix Height Width

Hope it works for you

Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
1

You can set the size of item in code using:

- (CGSize)collectionView:layout:sizeForItemAtIndexPath:

and

- (CGFloat)collectionView:layout:minimumInteritemSpacingForSectionAtIndex:

Make sure you calculate the real width of each cell based on the screen width: [[UIScreen mainScreen] bounds].size.width

xi.lin
  • 3,326
  • 2
  • 31
  • 57