0

Been a few weeks on design practice and an idea came up on my mind, i was trying to center my UICollectionView in the middle of the screen, i have used the Horizontal for this purpose, i tried to do that on storyboard, by editing the top,right,left,buttom pixels but it only works on the iPhone 7 Plus Simulator ScreenShot 2017

it is all fine, after switching to the normal iPhone 6 it goes to the left a bit while i got it centered on the property inspector

Screenshot

i am gonna be totally honest with you i haven't tried any codes to perform that action only in storyboard,

if you got something helpful, share it, i would appreciate it

for reference this is my property inspector..... thanks for visiting Screen

Caplin YT
  • 269
  • 1
  • 5
  • 16
  • What you mean is you want the `UICollectionViewCell` to be centered, correct? From the AutoLayout blue lines it looks like the collection view itself is properly positioned, just the cell is off because of the fixed spacing at the beginning. I would take a look at this answer: https://stackoverflow.com/a/37065909/7264964 – Paolo Aug 29 '17 at 19:52
  • Yes mate, already figured the layout issues, the main problem is the cell – Caplin YT Aug 29 '17 at 19:53
  • all the solutions were outdated mate – Caplin YT Aug 29 '17 at 19:59
  • it looks like the view inside the cell is not properly aligned. Did you check your layout consteaints for the box with rounded corners? – Björn Ro Aug 29 '17 at 20:41
  • yes, that is an imageView, i removed the imageview to see if its the problem, but no – Caplin YT Aug 29 '17 at 20:42
  • or maybe remove the insets and work with the layout constraints for the views inside the cell – Björn Ro Aug 29 '17 at 20:42
  • there is a fix left inset of 45, this could be the problem – Björn Ro Aug 29 '17 at 20:44
  • i tried, it did not work. it is not a problem with insets, otherwise i'll have to center it in code – Caplin YT Aug 29 '17 at 20:46

0 Answers0