今天为大家带来边框圆角是怎么样设置的
其他的三种我不说大家都知道 我们重点说一下最后一种
首先设置圆角的属性是 borderRadius 但是里面有一些参数也可以写数值
下面来介绍一下参数:
topLeft:左上角
topRight:右上角
bottomLeft:左下角
bottomRight:右下角
下面是代码演示
附上整个代码 各位关注老爷自行下载
import { radio } from '@kit.TelephonyKit' @Entry @Component struct Index { build() { Column() { Text() Image($r('app.media.gg')) .borderRadius(20) .width(200) .height(100) Text('我是椭圆') .borderRadius(50) .width(200) .height(50) .backgroundColor(Color.Red) .margin({ top: 20 }) .textAlign(TextAlign.Center) Text('我是圆形') .width(200) .height(200) .backgroundColor(Color.Pink) .borderRadius(100) .margin({ top: 20 }) .textAlign(TextAlign.Center) Text('VIP') .width(100) .height(40) .borderRadius({ topLeft: 20, bottomRight: 20 }) .backgroundColor(Color.Brown) .margin({ top: 20 }) .textAlign(TextAlign.Center) .fontSize(20) .fontColor('#fff') } .width('100%') .height('100%') .padding(20) } }