3

I am building some Mount Spec components to render specific Views. All my Views are supposed to have height = "wrap_content".

When I first started working on it I had not implemented the onMerasure() method (uses @OnMeasure annotation) so the component wouldn't display anything! After implementing the onMeasure() the components started working but with the resources available there's no way to calculate the component height (which shoould be done inside the onMeasure).

How can I make Litho Mount Spec work with Views that don't have fixed height?

thigobr
  • 51
  • 3

1 Answers1

0

Put:

MeasureUtils.measureWithAspectRatio(widthSpec, heightSpec, aspectRatio, size);

in your onMeasure() function

ScrollBart
  • 13
  • 2