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

and here inspector height constraint

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:
you aligned image horizontally , added leading constraint. remove it, if want have fixed image size.
if want view automatically resize image (by width) - remove width constraint & horizontal align , add trailing constraint.
it depends on goal.
hope helps
Comments
Post a Comment