HarmonyOS stack设置圆角不生效?

如题:HarmonyOS stack设置圆角不生效?

阅读 568
1 个回答

参考代码

@Entry
@Component
struct StackExample {
  build() {
    Stack({ alignContent: Alignment.Center }) {
      Text('First child, show in bottom').width('90%').height('80%').backgroundColor(0xd2cab3).align(Alignment.Top)
      Text('Second child, show in top').width('70%').height('60%').backgroundColor(0xc1cbac).align(Alignment.Top)
    }.width('100%').height(150).margin({ top: 300 }).borderRadius(33).backgroundColor(Color.Red)
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进