ios - UICollectionView as a subview doesn't update constraints -
i'm having autolayout puzzle. here's description:
i have uitableviewcell has "container view" basic uiview , uicollectionview subview of container view.
uitableviewcell -> uiview -> uicollectionview it's bit simplified end goal includes little more views under tableviewcell, sake of question should enough.
both uiview , uicollectionview have constraints in following format:
h:|[view]| , v:|[view]| (e.g. take full size of tableviewcell).
for reasons constraints not being updated after uicollectionview lays out it's cells.
here's works:
if replace
uicollectionviewuilabel, works fine (e.g. tableviewcell dynamically sized depending on label text).if remove intermediate uiview (the container view) puzzle again works fine (e.g. tableviewcell dynamically sized depending on number of cells in uicollectionview).
what doesn't work when have uicollectionview added intermediate view this: uitableviewcell -> uiview -> uicollectionview
any ideas how solve this?
apple not recommend use subviews other scrollable objects inside uitableview.
to achieve goal:
- add equalwidth constaint uicollectionview (to uitableviewcell)
- add equalheight constaint uicollectionview (to uitableviewcell)
Comments
Post a Comment