鸿蒙中边框属性是怎么样设置

今天为大家带来边框圆角是怎么样设置的

其他的三种我不说大家都知道 我们重点说一下最后一种

首先设置圆角的属性是 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)
  }
}
  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值