HarmonyOS入门2
·
HarmonyOS入门
组件
边框border
TextInput({placeholder:"用户名"})
.borderRadius(0)
.backgroundColor(Color.White)
.width("80%")
.borderWidth(1)//边框的宽度 其他地方也可以加
.borderColor("#cfcadd")//边框的颜色
.borderStyle(BorderStyle.Solid)//边框的样式
.border({ //统一设置 边框的简写
width:1,
color:"#cfcadd",
style:BorderStyle.Solid
radius:10
})
居中
//在column中
.alignItems(HorizontalAlign.Center) //水平居中
.justifyContent(FlexAlign.Center) //垂直居中
多选框
Checkbox({ name: "isAgree" }).height(14)
更多推荐



所有评论(0)