mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-23 08:30:06 +00:00
!3738 【Sample】修复chat朋友圈九宫格图片较少存在空白的问题
Merge pull request !3738 from 王田盛/master
This commit is contained in:
commit
b9a6948923
@ -31,6 +31,7 @@ const MAKE_LOCAL_DATA_TRACE_ID: number = 2; // makeDataLocal 中使用的 taskId
|
||||
const LAYOUT_WEIGHT: number = 1; // 自动分配剩余空间
|
||||
const LIST_SPACE: number = 8; // 列表默认间隔
|
||||
const PROMPT_DURATION: number = 3500; // 提示框持续时间
|
||||
const GRID_COLUMN_NUMBER: number = 3; // 九宫格每行图片数
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -126,7 +127,7 @@ struct FriendsMomentsPage {
|
||||
let message = (error as BusinessError).message;
|
||||
let code = (error as BusinessError).code;
|
||||
Logger.info(`showToast args error code is ${code}, message is ${message}`);
|
||||
};
|
||||
}
|
||||
}
|
||||
hiTraceMeter.finishTrace(MAKE_LOCAL_DATA_TRACE, MAKE_LOCAL_DATA_TRACE_ID);
|
||||
}
|
||||
@ -177,9 +178,9 @@ struct OneMoment {
|
||||
Column() {
|
||||
if (this.moment.imageList.length) {
|
||||
if (this.moment.imageList.length >= this.imageListMinLength) {
|
||||
Grid() {
|
||||
GridRow({ columns: GRID_COLUMN_NUMBER, gutter: $r('app.integer.friendMomentsPage_grid_gap') }) {
|
||||
ForEach(this.moment.imageList, (image: string, index?: number) => {
|
||||
GridItem() {
|
||||
GridCol() {
|
||||
Image(image)
|
||||
.id(`${index}`)
|
||||
.width($r('app.integer.friendMomentsPage_image_width'))
|
||||
@ -199,11 +200,6 @@ struct OneMoment {
|
||||
}
|
||||
}, (image: string) => image)
|
||||
}
|
||||
.columnsTemplate('1fr 1fr 1fr')
|
||||
.rowsTemplate('1fr 1fr 1fr')
|
||||
.columnsGap($r('app.integer.friendMomentsPage_grid_gap'))
|
||||
.rowsGap($r('app.integer.friendMomentsPage_grid_gap'))
|
||||
.height($r('app.integer.friendMomentsPage_grid_width'))
|
||||
.width($r('app.integer.friendMomentsPage_grid_height'))
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user