文档描述:在Row、Column、RelativeContainer组件中,width、height设置auto表示自适应子组件。
实际使用发现RelativeContainer不设置宽高时,无法根据子组件内容自适应宽高
文档描述:在Row、Column、RelativeContainer组件中,width、height设置auto表示自适应子组件。
实际使用发现RelativeContainer不设置宽高时,无法根据子组件内容自适应宽高
1 回答1k 阅读✓ 已解决
1 回答1.3k 阅读
1 回答1.1k 阅读
1 回答1.1k 阅读
1 回答1.1k 阅读
1 回答959 阅读
1 回答926 阅读
在RelativeContainer组件中,width、height设置auto表示自适应子组件。当width设置auto时,如果水平方向上子组件以容器作为锚点,则auto不生效,垂直方向上同理。https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-container-relativecontainer-0000001820880933
可以设置以兄弟组件为锚点,demo如下: