当前位置:网站首页>openharmony容器组件之Row
openharmony容器组件之Row
2022-08-09 13:12:00 【lplj717】
Row:沿水平方向布局的容器
Row(value:{space?: Length}) //space:横向布局元素间距,默认为0
Row属性:
1,alignItems(在垂直方向上子组件的对齐格式)
2,justifyContent8+(设置子组件在水平方向上的对齐格式)

上代码:
@Entry
@Component
struct ColumnT {
build() {
Column() {
Text('space').fontSize(9).fontColor(0x000000).width('90%')
//space:横向布局元素间距
Row({ 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:在垂直方向上子组件的对齐格式(属性有:Start,Center,End),默认(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:设置子组件在水平方向上的对齐格式
Row() { //注意:此处不能添加space属性,添加之后justifyContent属性失效(基于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%')
}
}边栏推荐
- Professor Chen Qiang "application in machine learning and R" course chapter 17
- Professor Chen Qiang's "Machine Learning and R Application" course Chapter 14 Assignment
- javscript基础易错点集合
- 力扣解法汇总1413-逐步求和得到正数的最小值
- 搭建大型分布式服务(四)Docker搭建开发环境安装Mysql
- 蓝桥历届真题-跑步锻炼
- pyautogui的简单操作(2)-弹窗操作
- FFmpeg multimedia file processing (ffmpeg prints audio and video Meta information)
- 禁止输入(×),按键精灵小程序,快速上手
- Q_08 更多信息
猜你喜欢
随机推荐
ArcEngine(九)图形绘制
R language kaggle game data exploration and visualization
Professor Chen Qiang the machine learning and R application course chapter 18 assignments
技嘉显卡 RGBFusion 不能调光解决方法
The sword refers to Offer 57 - II. and is a continuous positive sequence of s (sliding window)
FFmpeg长时间无响应的解决方法
处理JSON,fastjson、json-lib简单使用
Q_08 更多信息
Q_06_03 表达式
ArcEngine(八) 选择要素并高亮显示
RobotFramework 之 资源文件
Rmarkdown Tutorial
机器学习web服务化实战:一次吐血的服务化之路 (转载非原创)
微服务+微信小程序实现社区服务
Q_04_06 把它放在一起:传送
JZ7 重建二叉树
Q_04_07 进一步探索
GIN Bind mode to get parameters and form validation
蓝桥历届真题-跑步锻炼
音频基础学习——声音的本质、术语与特性









