下面让我来告诉你如何通过margin设置组件间的距离
实例:

顶部与下面的两个按钮之间紧密相连
设置margin后

产生了间隔
代码:
Row(){
Button('刷词条', { type: ButtonType.Capsule, stateEffect: true })
.backgroundColor('#FFFFFF').width('40%').height('5%').fontColor('#000000')
Button('抽词条', { type: ButtonType.Capsule, stateEffect: true })
.backgroundColor('#FFFFFF').width('40%').height('5%').fontColor('#000000')
}.margin({top:'10'})//--------具体顶部10
我们需要在组件UI描述加上margin属性
755

被折叠的 条评论
为什么被折叠?



