Showing
5 changed files
with
35 additions
and
17 deletions
| @@ -20,16 +20,28 @@ export struct TopNavigationComponent { | @@ -20,16 +20,28 @@ export struct TopNavigationComponent { | ||
| 20 | build() { | 20 | build() { |
| 21 | Column() { | 21 | Column() { |
| 22 | RelativeContainer(){ | 22 | RelativeContainer(){ |
| 23 | - Row(){ | ||
| 24 | - Image($r('app.media.icon_search')) | ||
| 25 | - .width(18) | ||
| 26 | - .height(18) | 23 | + Stack({ alignContent: Alignment.Center }){ |
| 24 | + | ||
| 25 | + Image($r('app.media.background_search')) | ||
| 26 | + .width('100%') | ||
| 27 | + .height('100%') | ||
| 28 | + .objectFit(ImageFit.Contain) | ||
| 29 | + | ||
| 30 | + Row(){ | ||
| 31 | + Image($r('app.media.icon_search')) | ||
| 32 | + .width(18) | ||
| 33 | + .height(18) | ||
| 34 | + | ||
| 35 | + Text('河南大雪') | ||
| 36 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 37 | + .fontSize($r('app.float.font_size_13')) | ||
| 38 | + } | ||
| 39 | + .alignItems(VerticalAlign.Center) | ||
| 40 | + .justifyContent(FlexAlign.Center) | ||
| 41 | + | ||
| 27 | } | 42 | } |
| 28 | - .alignItems(VerticalAlign.Center) | ||
| 29 | - .justifyContent(FlexAlign.Center) | ||
| 30 | .height(30) | 43 | .height(30) |
| 31 | .width(123) | 44 | .width(123) |
| 32 | - .backgroundColor($r('app.color.color_D8D8D8')) | ||
| 33 | .id('search') | 45 | .id('search') |
| 34 | .alignRules({ left: { anchor: "__container__", align: HorizontalAlign.Start }, | 46 | .alignRules({ left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 35 | center: { anchor: "__container__", align: VerticalAlign.Center } }) | 47 | center: { anchor: "__container__", align: VerticalAlign.Center } }) |
| @@ -50,19 +62,25 @@ export struct TopNavigationComponent { | @@ -50,19 +62,25 @@ export struct TopNavigationComponent { | ||
| 50 | .alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center }, | 62 | .alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center }, |
| 51 | center: { anchor: "__container__", align: VerticalAlign.Center } }) | 63 | center: { anchor: "__container__", align: VerticalAlign.Center } }) |
| 52 | 64 | ||
| 53 | - Row(){ | ||
| 54 | - Image($r('app.media.icon_read_paper_home')) | ||
| 55 | - .width(18) | ||
| 56 | - .height(18) | ||
| 57 | - Text('早晚报') | ||
| 58 | - .fontColor($r('app.color.color_fff')) | ||
| 59 | - .fontSize($r('app.float.font_size_13')) | 65 | + Stack({ alignContent: Alignment.Center }){ |
| 66 | + Image($r('app.media.background_read_paper_home')) | ||
| 67 | + .width('100%') | ||
| 68 | + .height('100%') | ||
| 69 | + .objectFit(ImageFit.Contain) | ||
| 70 | + Row(){ | ||
| 71 | + Image($r('app.media.icon_read_paper_home')) | ||
| 72 | + .width(18) | ||
| 73 | + .height(18) | ||
| 74 | + Text('早晚报') | ||
| 75 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 76 | + .fontSize($r('app.float.font_size_13')) | ||
| 77 | + } | ||
| 78 | + .alignItems(VerticalAlign.Center) | ||
| 79 | + .justifyContent(FlexAlign.Center) | ||
| 80 | + | ||
| 60 | } | 81 | } |
| 61 | - .alignItems(VerticalAlign.Center) | ||
| 62 | - .justifyContent(FlexAlign.Center) | ||
| 63 | .height(30) | 82 | .height(30) |
| 64 | .width(124) | 83 | .width(124) |
| 65 | - .backgroundColor($r('app.color.color_D8D8D8')) | ||
| 66 | .id('read') | 84 | .id('read') |
| 67 | .alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End }, | 85 | .alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End }, |
| 68 | center: { anchor: "__container__", align: VerticalAlign.Center } }) | 86 | center: { anchor: "__container__", align: VerticalAlign.Center } }) |
-
Please register or login to post a comment