Showing
2 changed files
with
49 additions
and
5 deletions
| @@ -13,6 +13,7 @@ import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | @@ -13,6 +13,7 @@ import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | ||
| 13 | import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem'; | 13 | import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem'; |
| 14 | import common from '@ohos.app.ability.common'; | 14 | import common from '@ohos.app.ability.common'; |
| 15 | import dataPreferences from '@ohos.data.preferences'; | 15 | import dataPreferences from '@ohos.data.preferences'; |
| 16 | +import { TitleBackComponent } from './TitleBackComponent'; | ||
| 16 | 17 | ||
| 17 | @Component | 18 | @Component |
| 18 | export struct MineSettingComponent { | 19 | export struct MineSettingComponent { |
| @@ -67,11 +68,15 @@ export struct MineSettingComponent { | @@ -67,11 +68,15 @@ export struct MineSettingComponent { | ||
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | build() { | 70 | build() { |
| 70 | - Navigation() { | ||
| 71 | - //滑动区域 | 71 | + // Navigation() { |
| 72 | + // //滑动区域 | ||
| 73 | + // this.settingList() | ||
| 74 | + // }.titleMode(NavigationTitleMode.Mini) | ||
| 75 | + // .title('设置') | ||
| 76 | + Column(){ | ||
| 77 | + TitleBackComponent({title:"设置"}) | ||
| 72 | this.settingList() | 78 | this.settingList() |
| 73 | - }.titleMode(NavigationTitleMode.Mini) | ||
| 74 | - .title('设置') | 79 | + } |
| 75 | } | 80 | } |
| 76 | 81 | ||
| 77 | // // 页面布局 | 82 | // // 页面布局 |
| @@ -159,7 +164,7 @@ export struct MineSettingComponent { | @@ -159,7 +164,7 @@ export struct MineSettingComponent { | ||
| 159 | }) | 164 | }) |
| 160 | }.onScrollFrameBegin((offset, state) => { | 165 | }.onScrollFrameBegin((offset, state) => { |
| 161 | return { offsetRemain: 0 } | 166 | return { offsetRemain: 0 } |
| 162 | - }) | 167 | + }).divider({strokeWidth:1,color:"#f0f0f0",startMargin: 15,endMargin: 10}) |
| 163 | } | 168 | } |
| 164 | .backgroundColor(Color.White) | 169 | .backgroundColor(Color.White) |
| 165 | .borderRadius(8) | 170 | .borderRadius(8) |
sight_harmony/features/wdComponent/src/main/ets/components/setting/TitleBackComponent.ets
0 → 100644
| 1 | +import { router } from '@kit.ArkUI' | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct TitleBackComponent { | ||
| 5 | + @State title: string = '' | ||
| 6 | + | ||
| 7 | + build() { | ||
| 8 | + RelativeContainer() { | ||
| 9 | + Text(this.title) | ||
| 10 | + .fontColor('#FF333333') | ||
| 11 | + .fontSize(18) | ||
| 12 | + .textAlign(TextAlign.Center) | ||
| 13 | + .height(44) | ||
| 14 | + .alignRules({ | ||
| 15 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 16 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 17 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 18 | + | ||
| 19 | + }) | ||
| 20 | + .id('titleContent') | ||
| 21 | + Image($r('app.media.back_icon')) | ||
| 22 | + .objectFit(ImageFit.Auto) | ||
| 23 | + .height(24) | ||
| 24 | + .width(24) | ||
| 25 | + .margin({ | ||
| 26 | + left: 16, top: 8 | ||
| 27 | + }) | ||
| 28 | + .alignRules({ | ||
| 29 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 30 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 31 | + }) | ||
| 32 | + .onClick(() => { | ||
| 33 | + router.back() | ||
| 34 | + }) | ||
| 35 | + .id('backImage') | ||
| 36 | + | ||
| 37 | + }.height(44) | ||
| 38 | + } | ||
| 39 | +} |
-
Please register or login to post a comment