当前位置:网站首页>Column of openharmony container component
Column of openharmony container component
2022-08-09 14:18:00 【lplj717】
Column: Container for vertical layout
Column(value:{space?: Length}) //space: vertical layout element spacing, the default is 0
Column property:
1, alignItems (set the alignment format of child components in the horizontal direction)
2, justifyContent8+ (set the vertical alignment of subcomponents)
Directly above:

The code above:
@[email protected] ColumnT {build() {Column() {Text('space').fontSize(9).fontColor(0x000000).width('90%')//space: vertical layout element spacingColumn({ space: 5 }) {Text().width('100%').height(30).backgroundColor(0xAFEEEE)Text().width('100%').height(30).backgroundColor(0x00FFFF)}.width('90%').height(80).border({ width: 1 })Text('alignItems').fontSize(9).fontColor(0x000000).width('90%')//alignItems: Set the alignment format of the sub-component in the horizontal direction (properties are: Start, Center, End), the default CenterColumn({ space: 5 }) {Text().width('50%').height(30).backgroundColor(0xAFEEEE)Text().width('50%').height(30).backgroundColor(0x00FFFF)}.alignItems(HorizontalAlign.Center).width('90%').height(80).border({ width: 1 })Text('justifyContent').fontSize(9).fontColor(0x000000).width('90%')//justifyContent: Set the vertical alignment of the child componentColumn() {//Note: The space attribute cannot be added here, and the justifyContent attribute will be invalid after adding it (based on sdk8)Text().width('50%').height(30).backgroundColor(0xAFEEEE)Text().width('50%').height(30).backgroundColor(0x00FFFF)}.height('15%').border({width:1}).justifyContent(FlexAlign.End)}.width('100%').height('100%')}}边栏推荐
猜你喜欢
随机推荐
程序员的七夕怎么过?不会是写代码吧
group by的工作原理和优化思路
缓存和数据库一致性问题
NC7 买卖股票的最好时机(一)
tkiner-canvas显示图片
处理XML,dom4j的简单使用
Process/Thread related in Sandbox - 1
FFmpeg multimedia file processing (the basic concept of ffmpeg processing stream data)
openharmony容器组件之Row
面试攻略系列(三)-- 高级开发工程师面试问些啥?
去IOE-EBS何去何从
pytest 之 fixture参数化
oracle财务数据权限思考
JS本地存储 sessionStorage和localStorage
javscript基础易错点集合
蓝桥历届真题-跑步锻炼
Jetpack Compose——Image(图片)的使用
pytest 与 unittest 的区别
从房产中介到程序员--80后张江男
PO、DO、TO、VO、DO、DTO、DAO、POJO都是什么?









