HarmonyOS 父组件的圆角如何作用于子组件

如下代码,给Swiper设置圆角后,如何让子组件的Image也显示圆角?

Swiper(){
  ForEach(this.bannerList,  (banner: NewsBannerContentlist, index: number) =>{
    Image(this.getImgUrl(banner.conentimg)).width('100%').height('100%')
  })
}.width(this.deviceWidth - CommonConstants.MARGIN_LEFT - CommonConstants.MARGIN_RIGHT)
.height((this.deviceWidth - CommonConstants.MARGIN_LEFT - CommonConstants.MARGIN_RIGHT) * 152 / 359)
.margin({
  left: CommonConstants.MARGIN_LEFT,
  right: CommonConstants.MARGIN_RIGHT
})
.clip(true)
.backgroundColor(Color.White)
.borderRadius(8)
.padding(2)
.indicator(
  Indicator.dot()
    .right(0)
    .itemWidth(6)
    .itemHeight(6)
    .selectedItemWidth(12)
    .selectedItemHeight(6)
    .color($r('app.color.color99FFFFFF'))
    .selectedColor(Color.White)
)
.loop(true)
.autoPlay(true)
.interval(5000)
HarmonyOS
2024-12-24 17:25:32
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Excelsior_abit

子组件Image要再设置:

Image($r('app.media.ic_banner03')).border({
  radius: { topLeft: 8, topRight: 8, bottomLeft: 8, bottomRight: 8 }
分享
微博
QQ
微信
回复
2024-12-24 18:51:24
相关问题
HarmonyOS 自定义装饰器不能作用于ets
747浏览 • 1回复 待解决
组件调用组件方法
1588浏览 • 1回复 待解决
HarmonyOS 组件超过组件范围
264浏览 • 1回复 待解决
组件调用组件方法
570浏览 • 1回复 待解决
HarmonyOS 组件调用组件方法demo
184浏览 • 1回复 待解决
HarmonyOS 组件调用组件方法
329浏览 • 1回复 待解决
HarmonyOS 组件超出组件布局
234浏览 • 1回复 待解决
HarmonyOS 组件超出组件宽度
228浏览 • 1回复 待解决
设置组件宽度不超出组件
793浏览 • 1回复 待解决
组件事件可以传到组件
911浏览 • 1回复 待解决
组件组件传递函数
517浏览 • 1回复 待解决