Reputation: 3545
I'm trying to customize size of the image inside my UICollectionViewCell, but I haven't managed to achieve the result yet.
here is my cell
and here is inspector for the height constraint
What am I doing wrong?
Update:
I've just noticed some logs
(
"<NSLayoutConstraint:0x78fcab10 V:[UIImageView:0x78fcaa00(129)]>",
"<NSLayoutConstraint:0x78fcb100 V:|-(8)-[UIImageView:0x78fcaa00] (Names: '|':UIView:0x78fca940 )>",
"<NSLayoutConstraint:0x78fcb130 V:[UILabel:0x78fcac40'Completed all MEDIUM quiz...']-(8)-| (Names: '|':UIView:0x78fca940 )>",
"<NSLayoutConstraint:0x78fcb190 V:[UIImageView:0x78fcaa00]-(8)-[UILabel:0x78fcac40'Completed all MEDIUM quiz...']>",
"<NSAutoresizingMaskLayoutConstraint:0x79195380 h=--& v=--& V:[UIView:0x78fca940(50)]>"
)
But I do not understand how NSAutoresizingMaskLayoutConstraint appears here.
Upvotes: 0
Views: 170
Reputation: 2413
From your screenshot:
you aligned image horizontally and added leading constraint. remove it, if you want to have fixed image size.
if you want your view to automatically resize image (by width) - remove width constraint & horizontal align and add trailing constraint.
It depends on goal.
Hope this helps
Upvotes: 1