- 2025-03-14RelativeContainer 盒子定位
@Entry@ComponentstructPage05_RelativeContainer{@Statemessage:string='HelloWorld'build(){//RelativeContainer(){//Column(){//Text('text1')//}.width(300).height(300).backgroundColor(Col
- 2025-03-05ArkTs-RelativeContainer高度限制方式
1.固定高度设置直接指定容器的绝对或相对高度值:RelativeContainer(){//子组件...}.width('100%').height(200)//固定高度200vp.backgroundColor('#F0F0F0')2.百分比高度基于父容器高度的百分比自适应:RelativeContainer(){//子组件...}.width('80
- 2025-02-05开天辟地 HarmonyOS(鸿蒙) - 组件(布局类): RelativeContainer(相对布局)
源码https://github.com/webabcd/HarmonyDemo作者webabcd开天辟地HarmonyOS(鸿蒙)-组件(布局类):RelativeContainer(相对布局)示例如下:pages\component\layout\RelativeContainerDemo.ets/**RelativeContainer-相对布局,通过约束做组件的布局*/import{TitleBa
- 2025-01-15《鸿蒙开发-答案之书》RelativeContainer不好理解?
《鸿蒙开发-答案之书》RelativeContainer不好理解?RelativeContainer关键是锚点,子组件要放那里?就比如我拿起这个子组件,它的右边要和父组件右边对齐。那我锚点就右边,然后去锚父组件的右。代码如下:RelativeContainer(){Text('123').width(30)