简体   繁体   中英

iOS 8.4 doesn't update constraints on uicollectionviewcell

I'm making a very simple collection view . I want an image in each cell that make half width of the cell. I modify the frame of the cell with

(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath

I have only 4 constraints on my image (I made them on the storyboard):

  • Leading space to cell leading = 0
  • Top space to cell top = 0
  • Bottom space to cell bottom = 0
  • Right space to cell center X = 0

The things is it looks fine on the storyboard, but don't work in real. Here an image : 在此处输入图片说明

What I'm doing wrong ?

Thank you

尝试在UIImageView上设置“缩放为填充模式”

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