在页面使用基于 List \> ListItem \> RelativeContainer \> Text(标题)+Text(内容)+ 其他,渲染列表,发现不指定 RelativeContainer 高度时,页面只显示第 1 个元素解决方案RelativeContainer支持宽高自适应子组件,将其宽高属性设置为auto即可,但限制是当width设置auto时,如果垂直方向上子组件以容器作为锚点,则auto不生效,水平方向上同理,具体使用方法请参考文档。文档链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-container-relativecontainer-V5
在页面使用基于 List \> ListItem \> RelativeContainer \> Text(标题)+Text(内容)+ 其他,渲染列表,发现不指定 RelativeContainer 高度时,页面只显示第 1 个元素解决方案
RelativeContainer支持宽高自适应子组件,将其宽高属性设置为auto即可,但限制是当width设置auto时,如果垂直方向上子组件以容器作为锚点,则auto不生效,水平方向上同理,具体使用方法请参考文档。
文档链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-container-relativecontainer-V5