yangchenggong1_wd

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

... ... @@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI {
build(){
Row(){
//头像
Stack({alignContent: Alignment.Center}){
Stack(){
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('108lpx')
.height('108lpx')
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
.borderRadius(50)
Image(this.levelHead)
.width('130lpx')
.height('130lpx')
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
.borderRadius(50)
}.width('130lpx')
.height('130lpx')
.alignContent(Alignment.Center)
... ...
... ... @@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{
this.currentIndex = index
})
.width('100%')
.height('100%')
.layoutWeight(1)
}.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{
if(this.data != null){
if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id})
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
}else{
this.FollowSecondUI()
}
}
}
.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder FollowSecondUI(){
... ...
... ... @@ -128,7 +128,7 @@ export struct HomePageBottomComponent{
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({data: item})
ChildCommentComponent({data: item,isLastItem:index===this.data_comment.totalCount()-1})
}
.onClick(() => {
})
... ... @@ -158,7 +158,7 @@ export struct HomePageBottomComponent{
})
}
}
}.height('100%')
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
.width('100%')
}
... ... @@ -334,6 +334,7 @@ struct ChildFollowComponent {
@Component
struct ChildCommentComponent {
@ObjectLink data: CommentListItem
isLastItem: boolean = false
build() {
Column(){
... ... @@ -408,10 +409,12 @@ struct ChildCommentComponent {
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'19lpx',bottom:'31lpx'})
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.backgroundColor($r('app.color.color_F5F5F5'))
if(!this.isLastItem){
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.color($r('app.color.color_F5F5F5'))
}
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({data: item,levelHead:this.levelHead})
ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1})
}
.onClick(() => {
})
... ... @@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{
}
}
.width('100%')
.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}
... ... @@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{
struct ChildCommentComponent {
@ObjectLink data: CommentListItem
@Prop levelHead:string
isLastItem: boolean = false
build() {
Column(){
... ... @@ -234,10 +237,12 @@ struct ChildCommentComponent {
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'19lpx',bottom:'31lpx'})
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.backgroundColor($r('app.color.color_F5F5F5'))
if(!this.isLastItem){
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.color($r('app.color.color_F5F5F5'))
}
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -197,16 +197,15 @@ struct MineHomePage {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
.layoutWeight(1)
}
}.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder MineHomeTitleTransparent() {
... ...
... ... @@ -190,16 +190,15 @@ struct OtherNormalUserHomePage {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
.layoutWeight(1)
}
}.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder MineHomeTitleTransparent() {
... ...