属性:shadow()
它的写法
{
radius: 模糊半径,
type?: 阴影类型,
color?: 阴影颜色,
offsetX?: X轴偏移,
offsetY?: Y轴偏移,
fill?: 是否内部填充
}
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
build() {
//阴影
Text()
.width(200)
.height(200)
.margin(50)
.backgroundColor(Color.Brown)
.shadow({
radius:30, //边缘半径
color:'#000',//颜色
offsetX:20, //左右移动
offsetY:20, //上下移动
type:ShadowType.COLOR, //阴影类型
fill:true
})
}
}