当前位置:网站首页>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%')}}边栏推荐
猜你喜欢
随机推荐
使用 NVIDIA Kaolin Wisp 重建3D场景
pytest 基础认知
面试攻略系列(三)-- 高级开发工程师面试问些啥?
javscript基础易错点集合
皮肤资料整理
Mysql的七种连接查询方法
Jetpack Compose——remember、mutableStateOf、rememberSaveable
FFmpeg multimedia file processing (implementation of ffmpeg operation directory and list)
激光器如何养护才能远离结露没烦恼
opencv-matchTemplate 之使用场景为大图里面找小图
openharmony容器组件之Row
记一次 ERROR scheduler.AsyncEventQueue: Dropping event from queue shared导致OOM
FFmpeg av_interleaved_write_frame错误
音频基础学习——声音的本质、术语与特性
Q_06_02 类型模型
WPF 系统托盘 图标闪烁
机器学习web服务化实战:一次吐血的服务化之路 (转载非原创)
vs怎么用一个Button链接到另一个页面
富媒体在客服IM消息通信中的秒发实践
pyhook3简单应用(1)--实现截图保存功能









