I have some problems with autolayout and UICollectionViewCell
. You can see cell prototype scheme below. Green rectangle is UILabel
and 2 red rectangles are UIImages.
I have defined following constraints:
UILabel
is centered in cellUILabel
has fixed top spacing to cell (5pt)UIImages
andUILabel
has center Y alignmentUIImage
andUILabel
has defined horizontal spacing (5pt)
My goal is:
I need to stretch my label
according to its contentSize, so UIImages
are exactly 5 pt from text, not from UILabel
border.
Is it possible without calculating in code and assigning values to width constraint?