Showing
1 changed file
with
8 additions
and
6 deletions
| @@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index'; | @@ -5,7 +5,7 @@ import { SPHelper } from 'wdKit/Index'; | ||
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; | 6 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; |
| 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 8 | -import { ImageKnifeComponent } from '@ohos/imageknife'; | 8 | +import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife'; |
| 9 | 9 | ||
| 10 | @Entry | 10 | @Entry |
| 11 | @Component | 11 | @Component |
| @@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage { | @@ -13,6 +13,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 13 | @State message: string = 'Hello World' | 13 | @State message: string = 'Hello World' |
| 14 | @State selectCount: number = 0 | 14 | @State selectCount: number = 0 |
| 15 | @State interestsArray: InterestsList[] = [] | 15 | @State interestsArray: InterestsList[] = [] |
| 16 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 17 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 16 | 18 | ||
| 17 | aboutToAppear(){ | 19 | aboutToAppear(){ |
| 18 | //请求接口,获取兴趣偏好数据 | 20 | //请求接口,获取兴趣偏好数据 |
| @@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage { | @@ -39,6 +41,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 39 | this.trackingLaunchJumpOver(false) | 41 | this.trackingLaunchJumpOver(false) |
| 40 | }) | 42 | }) |
| 41 | } | 43 | } |
| 44 | + .margin({top:px2vp(this.topSafeHeight)}) | ||
| 42 | .width('100%') | 45 | .width('100%') |
| 43 | .justifyContent(FlexAlign.End) | 46 | .justifyContent(FlexAlign.End) |
| 44 | 47 | ||
| @@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage { | @@ -62,7 +65,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 62 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ | 65 | ForEach(this.interestsArray,(item:InterestsList,index:number)=>{ |
| 63 | GridItem(){ | 66 | GridItem(){ |
| 64 | Stack({alignContent:Alignment.TopStart}){ | 67 | Stack({alignContent:Alignment.TopStart}){ |
| 65 | - ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}}) | 68 | + ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic,mainScaleType:ScaleType.FIT_XY}}) |
| 66 | .width('100%') | 69 | .width('100%') |
| 67 | .height('100%') | 70 | .height('100%') |
| 68 | .backgroundColor(Color.White) | 71 | .backgroundColor(Color.White) |
| @@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage { | @@ -98,7 +101,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 98 | Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | 101 | Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) |
| 99 | .height('32lpx') | 102 | .height('32lpx') |
| 100 | .width('32lpx') | 103 | .width('32lpx') |
| 101 | - .margin({top:'80lpx',left:'110lpx'}) | 104 | + .margin({top:'80lpx',left:'120lpx'}) |
| 102 | 105 | ||
| 103 | }.justifyContent(FlexAlign.Start) | 106 | }.justifyContent(FlexAlign.Start) |
| 104 | } | 107 | } |
| @@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage { | @@ -118,8 +121,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 118 | }) | 121 | }) |
| 119 | } | 122 | } |
| 120 | .width('90%') | 123 | .width('90%') |
| 121 | - // .height('70%') | ||
| 122 | - .margin({top:'61lpx',bottom:'240lpx'}) | 124 | + .margin({top:'61lpx',bottom:'300lpx'}) |
| 123 | .columnsTemplate('1fr 1fr 1fr') | 125 | .columnsTemplate('1fr 1fr 1fr') |
| 124 | .columnsGap('23lpx') | 126 | .columnsGap('23lpx') |
| 125 | .rowsGap('23lpx') | 127 | .rowsGap('23lpx') |
| @@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage { | @@ -129,7 +131,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 129 | .height('100%') | 131 | .height('100%') |
| 130 | } | 132 | } |
| 131 | .width('100%') | 133 | .width('100%') |
| 132 | - .height(`calc(100% - ${108 + 'lpx'})`) | 134 | + .height(`calc(100% - ${158 + 'lpx'})`) |
| 133 | // .backgroundColor(Color.Red) | 135 | // .backgroundColor(Color.Red) |
| 134 | 136 | ||
| 135 | Stack({alignContent:Alignment.Center}){ | 137 | Stack({alignContent:Alignment.Center}){ |
-
Please register or login to post a comment