当前位置:网站首页>Row of openharmony container components
Row of openharmony container components
2022-08-09 14:18:00 【lplj717】
Row: Containers laid out horizontally
Row(value:{space?: Length}) //space: horizontal layout element spacing, the default is 0
Row property:
1, alignItems (alignment format of child components in the vertical direction)
2, justifyContent8+ (set the alignment format of subcomponents in the horizontal direction)
The code above:
@[email protected] ColumnT {build() {Column() {Text('space').fontSize(9).fontColor(0x000000).width('90%')//space: horizontal layout element spacingRow({ space: 5 }) {Text().width('30%').height(30).backgroundColor(0xAFEEEE)Text().width('30%').height(30).backgroundColor(0x00FFFF)}.width('90%').height(80).border({ width: 1 })Text('alignItems').fontSize(9).fontColor(0x000000).width('90%')//alignItems: The alignment format of subcomponents in the vertical direction (properties are: Start, Center, End), default (Center)Row({ space: 5 }) {Text().width('30%').height(30).backgroundColor(0xAFEEEE)Text().width('30%').height(30).backgroundColor(0x00FFFF)}.alignItems(VerticalAlign.Center).width('90%').height(80).border({ width: 1 })Text('justifyContent').fontSize(9).fontColor(0x000000).width('90%')//justifyContent: Set the alignment format of the child component in the horizontal directionRow() { //Note: The space attribute cannot be added here, the justifyContent attribute will be invalid after adding (based on sdk8)Text().width('30%').height(30).backgroundColor(0xAFEEEE)Text().width('30%').height(30).backgroundColor(0x00FFFF)}.width('90%').height(80).border({ width: 1 }).justifyContent(FlexAlign.End)}.width('100%').height('100%')}}
边栏推荐
猜你喜欢
随机推荐
利用信号灯和共享内存实现进程间同步通信
蓝桥历届真题-蛇形填数
远程控制软件-向日葵
NC193 二叉树的前序遍历
Process/Thread Related in Sandbox - 2
openharmony容器组件之Counter
NC192 二叉树的后序遍历
如何用vs新建Asp.net项目(Web页面)
一篇ngork直接使用
Q_06_04 语句和其他构造
RobotFramework简介
面试攻略系列(三)-- 高级开发工程师面试问些啥?
pytest 之 重运行机制与测试报告
Q_07 词汇表
开源一夏│别逗,作为程序员你竟还没参与过开源项目?
Spark Sql之union
NC161 二叉树的中序遍历
Spark读取多目录
易语言获取cookie
使用 NVIDIA Kaolin Wisp 重建3D场景