如题:HarmonyOS 使用List的警告:You are advised to initialize the width and height attributes of the List component.?
如题:HarmonyOS 使用List的警告:You are advised to initialize the width and height attributes of the List component.?
1 回答1.1k 阅读✓ 已解决
1 回答1.4k 阅读
1 回答1.2k 阅读
1 回答1.1k 阅读
1 回答1.1k 阅读
1 回答1k 阅读
1 回答988 阅读
问题场景
这个警告不影响的实际的使用的,如果没有初始化高度List组件会自适应高度,但是这会导致在某些情况下显示不全的情况,可以设置一下layoutWeight属性(需要父组件设置固定高度)这样List组件就可以和兄弟组件按权重分配父组件尺寸