鸿蒙开发

Time: 2024-07-12 Friday 18:45:01
Author: Jackasher

鸿蒙开发

胶囊图形

1
2
3
Image($r('app.media.startIcon'))
.width(100)
.borderRadius(50)

borderRadiusheight的一半就是胶囊状图形,而widthweigth一样时即为圆形

背景颜色

1
2
3
TextInput({
placeholder: "密码"
}).type(InputType.Password).backgroundImage($r("app.media.background"),ImageRepeat.XY)

背景图片平铺

1
2
3
4
5
6
7
8
Text("Hello")
.width('300vp')
.height('200vp')
.backgroundColor(Color.Pink)
.backgroundImage($r('app.media.app_icon'))
.backgroundImagePosition({x:vp2px(400),y:vp2px(300)})
.backgroundImageSize(ImageSize.Contain)
.backgroundImagePosition(Alignment.Center)

背景设置

线性布局


鸿蒙开发
http://example.com/2024/07/12/鸿蒙开发/
作者
Jack Asher
发布于
2024年7月12日
许可协议