diff --git a/entry/src/main/ets/view/TrafficView.ets b/entry/src/main/ets/view/TrafficView.ets index c41c0f8b7b8fdb6b8dadc764a23d27a813cd7b42..f5b1856f87e39451e20ff89163d31f533d446d50 100644 --- a/entry/src/main/ets/view/TrafficView.ets +++ b/entry/src/main/ets/view/TrafficView.ets @@ -125,14 +125,9 @@ export struct TrafficView { .objectFit(ImageFit.Contain) .height(new BreakpointType(70, 80, 80).getValue(this.horizontalBreakpoint)) } - .margin({ - left: new BreakpointType($r('sys.float.padding_level36'), $r('sys.float.padding_level12'), - $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), - top: $r('sys.float.padding_level2'), - }) .width(new BreakpointType('100%', '40%', '30%').getValue(this.horizontalBreakpoint)) } - .padding({ + .margin({ left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), top: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level16'), @@ -170,23 +165,29 @@ export struct TrafficView { Blank() - if (this.horizontalBreakpoint !== Constants.BREAK_POINT_SM || - this.verticalBreakpoint !== Constants.BREAK_POINT_MD) { - Row() { - TrafficInfoView() + Row(){ + if (this.horizontalBreakpoint !== Constants.BREAK_POINT_SM || + this.verticalBreakpoint !== Constants.BREAK_POINT_MD) { + Row() { + TrafficInfoView() + } + .onSizeChange(() => { + this.isShow = false; + }) + .margin({ + left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), + $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), + }) + .backgroundColor($r('sys.color.background_secondary')) + .width(new BreakpointType('100%', '50%', '30%').getValue(this.horizontalBreakpoint)) + .height(120) + .borderRadius({ + topLeft: 32, + topRight: 32, + }) } - .margin({ - left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), - $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), - }) - .backgroundColor($r('sys.color.background_secondary')) - .width(new BreakpointType('100%', '50%', '30%').getValue(this.horizontalBreakpoint)) - .height(120) - .borderRadius({ - topLeft: 32, - topRight: 32, - }) } + .width('100%') } .bindSheet($$this.isShow, this.myBuilder(), { height: 90,