From 2a8692343a2ee1503f49c1f88ae8ea65623f0c49 Mon Sep 17 00:00:00 2001 From: EasyGuohf <163991322+EasyGuohf@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:32:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E5=8F=B3=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/component/MailNavigation.ets | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/multicolumnslibrary/src/main/ets/component/MailNavigation.ets b/multicolumnslibrary/src/main/ets/component/MailNavigation.ets index d8841fd..f33c5dd 100644 --- a/multicolumnslibrary/src/main/ets/component/MailNavigation.ets +++ b/multicolumnslibrary/src/main/ets/component/MailNavigation.ets @@ -21,8 +21,10 @@ import { MailContent } from './MailContent'; export struct MailNavigation { @State pathInfo: NavPathStack = new NavPathStack(); @State mailList: string[] = ['1', '1', '1', '1', '1', '1']; + @State selectedIndex: number = 2; @StorageProp(Constants.KEY_BREAKPOINT) currentBreakPoint: string = BreakpointTypeEnum.MD; @StorageProp(Constants.KEY_STATUS_BAR_HEIGHT) statusBarHeight: number = 0; + @StorageProp(Constants.KEY_NAV_INDICATOR_HEIGHT) navIndicatorHeight: number = 0; @Builder myRouter(name: string) { @@ -85,11 +87,11 @@ export struct MailNavigation { build() { Navigation(this.pathInfo) { - Stack({ alignContent: Alignment.Start }) { + Stack({ alignContent: Alignment.BottomEnd }) { Column() { Search({ placeholder: $r('app.string.searchMail') }) List() { - ForEach(this.mailList, (item: string, index: number | undefined) => { + ForEach(this.mailList, (item: string, index: number) => { ListItem() { Column() { Row() { @@ -120,7 +122,10 @@ export struct MailNavigation { .justifyContent(FlexAlign.Center) } .padding({ left: $r('sys.float.padding_level6'), right: $r('sys.float.padding_level6') }) - .backgroundColor(index === 2 ? $r('app.color.item_selected_color') : undefined) + .margin({ + bottom: index === this.mailList.length - 1 ? this.navIndicatorHeight : 0 + }) + .backgroundColor(index === this.selectedIndex ? $r('app.color.item_selected_color') : undefined) .borderRadius($r('sys.float.corner_radius_level5')) }, (item: string) => item.toString()) } @@ -135,7 +140,8 @@ export struct MailNavigation { .width('100%') .layoutWeight(1) } - .height('100%').width('100%') + .height('100%') + .width('100%') .padding({ left: new BreakpointType({ sm: $r('sys.float.padding_level8'), @@ -153,7 +159,11 @@ export struct MailNavigation { Image($r('app.media.ic_public_list_add_light')) .width($r('app.float.image_size_48')) .height($r('app.float.image_size_48')) - .position({ x: 240, y: 549 }) + .margin({ + right: $r('sys.float.padding_level16'), + bottom: this.currentBreakPoint === BreakpointTypeEnum.SM ? $r('sys.float.padding_level32') : + $r('sys.float.padding_level24') + }) } } } -- Gitee From 7add96c5679e545e5e3750e848a2f5f278c205ef Mon Sep 17 00:00:00 2001 From: EasyGuohf <163991322+EasyGuohf@users.noreply.github.com> Date: Tue, 5 Aug 2025 20:48:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E5=8F=B3=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- multicolumnslibrary/src/main/ets/component/MailNavigation.ets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multicolumnslibrary/src/main/ets/component/MailNavigation.ets b/multicolumnslibrary/src/main/ets/component/MailNavigation.ets index f33c5dd..484e8c1 100644 --- a/multicolumnslibrary/src/main/ets/component/MailNavigation.ets +++ b/multicolumnslibrary/src/main/ets/component/MailNavigation.ets @@ -25,6 +25,7 @@ export struct MailNavigation { @StorageProp(Constants.KEY_BREAKPOINT) currentBreakPoint: string = BreakpointTypeEnum.MD; @StorageProp(Constants.KEY_STATUS_BAR_HEIGHT) statusBarHeight: number = 0; @StorageProp(Constants.KEY_NAV_INDICATOR_HEIGHT) navIndicatorHeight: number = 0; + private mailListSize: number = this.mailList.length; @Builder myRouter(name: string) { @@ -123,7 +124,7 @@ export struct MailNavigation { } .padding({ left: $r('sys.float.padding_level6'), right: $r('sys.float.padding_level6') }) .margin({ - bottom: index === this.mailList.length - 1 ? this.navIndicatorHeight : 0 + bottom: index === this.mailListSize - 1 ? this.navIndicatorHeight : 0 }) .backgroundColor(index === this.selectedIndex ? $r('app.color.item_selected_color') : undefined) .borderRadius($r('sys.float.corner_radius_level5')) -- Gitee