> 文档中心 > HarmonyOS应用开发:Blank()空白布局

HarmonyOS应用开发:Blank()空白布局

空白填充组件,在容器主轴方向上,空白填充组件具有自动填充容器空余部分的能力。仅当父组件为Row/Column时生效

接口

Blank(min?: number | string)

参数

参数名 参数类型 必填 参数描述
min number | string 空白填充组件在容器主轴上的最小大小。
默认值:0

属性

除支持通用属性外,还支持以下属性:

名称 参数类型 描述
color ResourceColor 设置空白填充的填充颜色。

示例:

// xxx.ets@Entry@Componentstruct BlankExample {  build() {    Column() {      Row() { Text('Bluetooth').fontSize(18) Blank() Toggle({ type: ToggleType.Switch })      }.width('100%').backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })    }.backgroundColor(0xEFEFEF).padding(20)  }}

 

墨言文学成语大全