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:

  1. if replace uicollectionview uilabel, works fine (e.g. tableviewcell dynamically sized depending on label text).

  2. 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:

  1. add equalwidth constaint uicollectionview (to uitableviewcell)
  2. add equalheight constaint uicollectionview (to uitableviewcell)

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#? -