![](/img/trans.png)
[英]How to set wrap_content with min height on view OnMeasure?
[英]Using MountSpec component with “wrap_content” View - How to implement onMeasure()
我正在构建一些Mount Spec组件以呈现特定的视图。 我所有的视图都应该具有height =“ wrap_content”。
当我第一次开始使用它时,我没有实现onMerasure()方法(使用@OnMeasure注释),因此该组件不会显示任何内容! 实施onMeasure()之后,组件开始工作,但是利用可用资源,无法计算组件高度(应在onMeasure内部完成)。
如何使Litho Mount Spec与没有固定高度的View一起使用?
放:
MeasureUtils.measureWithAspectRatio(widthSpec, heightSpec, aspectRatio, size);
在您的onMeasure()函数中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.