ios - NSLayoutConstraint in UICollectionViewCell: Size Class Customization doesn't work -


i'm trying customize size of image inside uicollectionviewcell, haven't managed achieve result yet.

here cell

enter image description here

and here inspector height constraint

enter image description here

what doing wrong?

update:

i've noticed logs

(     "<nslayoutconstraint:0x78fcab10 v:[uiimageview:0x78fcaa00(129)]>",     "<nslayoutconstraint:0x78fcb100 v:|-(8)-[uiimageview:0x78fcaa00]   (names: '|':uiview:0x78fca940 )>",     "<nslayoutconstraint:0x78fcb130 v:[uilabel:0x78fcac40'completed medium quiz...']-(8)-|   (names: '|':uiview:0x78fca940 )>",     "<nslayoutconstraint:0x78fcb190 v:[uiimageview:0x78fcaa00]-(8)-[uilabel:0x78fcac40'completed medium quiz...']>",     "<nsautoresizingmasklayoutconstraint:0x79195380 h=--& v=--& v:[uiview:0x78fca940(50)]>" ) 

but not understand how nsautoresizingmasklayoutconstraint appears here.

from screenshot:

  1. you aligned image horizontally , added leading constraint. remove it, if want have fixed image size.

  2. if want view automatically resize image (by width) - remove width constraint & horizontal align , add trailing constraint.

it depends on goal.

hope helps


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -