yangchenggong1_wd

desc:解决 List组件 显示不全问题

@@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI { @@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI {
30 build(){ 30 build(){
31 Row(){ 31 Row(){
32 //头像 32 //头像
33 - Stack({alignContent: Alignment.Center}){ 33 + Stack(){
34 Image(this.headPhotoUrl) 34 Image(this.headPhotoUrl)
35 .alt($r('app.media.default_head')) 35 .alt($r('app.media.default_head'))
36 .width('108lpx') 36 .width('108lpx')
37 .height('108lpx') 37 .height('108lpx')
38 - .objectFit(ImageFit.Auto) 38 + .objectFit(ImageFit.Cover)
39 .borderRadius(50) 39 .borderRadius(50)
40 Image(this.levelHead) 40 Image(this.levelHead)
41 .width('130lpx') 41 .width('130lpx')
42 .height('130lpx') 42 .height('130lpx')
43 - .objectFit(ImageFit.Auto) 43 + .objectFit(ImageFit.Cover)
  44 + .borderRadius(50)
44 }.width('130lpx') 45 }.width('130lpx')
45 .height('130lpx') 46 .height('130lpx')
46 .alignContent(Alignment.Center) 47 .alignContent(Alignment.Center)
@@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{ @@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{
80 this.currentIndex = index 80 this.currentIndex = index
81 }) 81 })
82 .width('100%') 82 .width('100%')
83 - .height('100%') 83 + .layoutWeight(1)
84 }.width('100%') 84 }.width('100%')
85 } 85 }
86 } 86 }
@@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{ @@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{
23 23
24 if(this.data != null){ 24 if(this.data != null){
25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){ 25 if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
26 - FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}) 26 + FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
27 }else{ 27 }else{
28 this.FollowSecondUI() 28 this.FollowSecondUI()
29 } 29 }
30 } 30 }
31 } 31 }
32 .width('100%') 32 .width('100%')
33 - .height('100%') 33 + .layoutWeight(1)
34 } 34 }
35 35
36 @Builder FollowSecondUI(){ 36 @Builder FollowSecondUI(){
@@ -128,7 +128,7 @@ export struct HomePageBottomComponent{ @@ -128,7 +128,7 @@ export struct HomePageBottomComponent{
128 List({ space: 3 }) { 128 List({ space: 3 }) {
129 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 129 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
130 ListItem() { 130 ListItem() {
131 - ChildCommentComponent({data: item}) 131 + ChildCommentComponent({data: item,isLastItem:index===this.data_comment.totalCount()-1})
132 } 132 }
133 .onClick(() => { 133 .onClick(() => {
134 }) 134 })
@@ -158,7 +158,7 @@ export struct HomePageBottomComponent{ @@ -158,7 +158,7 @@ export struct HomePageBottomComponent{
158 }) 158 })
159 } 159 }
160 } 160 }
161 - }.height('100%') 161 + }.layoutWeight(1)
162 .justifyContent(FlexAlign.Start) 162 .justifyContent(FlexAlign.Start)
163 .width('100%') 163 .width('100%')
164 } 164 }
@@ -334,6 +334,7 @@ struct ChildFollowComponent { @@ -334,6 +334,7 @@ struct ChildFollowComponent {
334 @Component 334 @Component
335 struct ChildCommentComponent { 335 struct ChildCommentComponent {
336 @ObjectLink data: CommentListItem 336 @ObjectLink data: CommentListItem
  337 + isLastItem: boolean = false
337 338
338 build() { 339 build() {
339 Column(){ 340 Column(){
@@ -408,10 +409,12 @@ struct ChildCommentComponent { @@ -408,10 +409,12 @@ struct ChildCommentComponent {
408 .backgroundColor($r('app.color.color_F5F5F5')) 409 .backgroundColor($r('app.color.color_F5F5F5'))
409 .margin({top:'19lpx',bottom:'31lpx'}) 410 .margin({top:'19lpx',bottom:'31lpx'})
410 411
411 - Divider().width('100%')  
412 - .height('12lpx')  
413 - .strokeWidth('12lpx')  
414 - .backgroundColor($r('app.color.color_F5F5F5')) 412 + if(!this.isLastItem){
  413 + Divider().width('100%')
  414 + .height('12lpx')
  415 + .strokeWidth('12lpx')
  416 + .color($r('app.color.color_F5F5F5'))
  417 + }
415 418
416 } 419 }
417 .justifyContent(FlexAlign.Center) 420 .justifyContent(FlexAlign.Center)
@@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{
37 List({ space: 3 }) { 37 List({ space: 3 }) {
38 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 38 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
39 ListItem() { 39 ListItem() {
40 - ChildCommentComponent({data: item,levelHead:this.levelHead}) 40 + ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1})
41 } 41 }
42 .onClick(() => { 42 .onClick(() => {
43 }) 43 })
@@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{ @@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{
68 } 68 }
69 } 69 }
70 .width('100%') 70 .width('100%')
  71 + .layoutWeight(1)
  72 + .justifyContent(FlexAlign.Start)
71 } 73 }
72 74
73 75
@@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{
143 struct ChildCommentComponent { 145 struct ChildCommentComponent {
144 @ObjectLink data: CommentListItem 146 @ObjectLink data: CommentListItem
145 @Prop levelHead:string 147 @Prop levelHead:string
  148 + isLastItem: boolean = false
146 149
147 build() { 150 build() {
148 Column(){ 151 Column(){
@@ -234,10 +237,12 @@ struct ChildCommentComponent { @@ -234,10 +237,12 @@ struct ChildCommentComponent {
234 .backgroundColor($r('app.color.color_F5F5F5')) 237 .backgroundColor($r('app.color.color_F5F5F5'))
235 .margin({top:'19lpx',bottom:'31lpx'}) 238 .margin({top:'19lpx',bottom:'31lpx'})
236 239
237 - Divider().width('100%')  
238 - .height('12lpx')  
239 - .strokeWidth('12lpx')  
240 - .backgroundColor($r('app.color.color_F5F5F5')) 240 + if(!this.isLastItem){
  241 + Divider().width('100%')
  242 + .height('12lpx')
  243 + .strokeWidth('12lpx')
  244 + .color($r('app.color.color_F5F5F5'))
  245 + }
241 246
242 } 247 }
243 .justifyContent(FlexAlign.Center) 248 .justifyContent(FlexAlign.Center)
@@ -197,16 +197,15 @@ struct MineHomePage { @@ -197,16 +197,15 @@ struct MineHomePage {
197 this.currentIndex = index 197 this.currentIndex = index
198 }) 198 })
199 .vertical(false) 199 .vertical(false)
200 - .height("100%")  
201 }.width("100%") 200 }.width("100%")
202 } 201 }
203 .edgeEffect(EdgeEffect.None) 202 .edgeEffect(EdgeEffect.None)
204 .scrollBar(BarState.Off) 203 .scrollBar(BarState.Off)
205 .width('100%') 204 .width('100%')
206 - .height('100%') 205 + .layoutWeight(1)
207 } 206 }
208 }.width('100%') 207 }.width('100%')
209 - .height('100%') 208 + .layoutWeight(1)
210 209
211 } 210 }
212 @Builder MineHomeTitleTransparent() { 211 @Builder MineHomeTitleTransparent() {
@@ -190,16 +190,15 @@ struct OtherNormalUserHomePage { @@ -190,16 +190,15 @@ struct OtherNormalUserHomePage {
190 this.currentIndex = index 190 this.currentIndex = index
191 }) 191 })
192 .vertical(false) 192 .vertical(false)
193 - .height("100%")  
194 }.width("100%") 193 }.width("100%")
195 } 194 }
196 .edgeEffect(EdgeEffect.None) 195 .edgeEffect(EdgeEffect.None)
197 .scrollBar(BarState.Off) 196 .scrollBar(BarState.Off)
198 .width('100%') 197 .width('100%')
199 - .height('100%') 198 + .layoutWeight(1)
200 } 199 }
201 }.width('100%') 200 }.width('100%')
202 - .height('100%') 201 + .layoutWeight(1)
203 202
204 } 203 }
205 @Builder MineHomeTitleTransparent() { 204 @Builder MineHomeTitleTransparent() {