fix
This commit is contained in:
@@ -46,9 +46,7 @@ export class DetailImageItem extends Component {
|
||||
if (!this.img || !this.img.spriteFrame) return;
|
||||
|
||||
// 延迟一帧确保UI布局完成
|
||||
this.scheduleOnce(() => {
|
||||
this.doScaleToFill();
|
||||
}, 0);
|
||||
this.doScaleToFill();
|
||||
}
|
||||
|
||||
doScaleToFill() {
|
||||
@@ -85,7 +83,7 @@ export class DetailImageItem extends Component {
|
||||
refresh(path: string, base: GirlDetailPanel, isImage: boolean = true) {
|
||||
this.base = base;
|
||||
this.lock.active = false;
|
||||
this.question.active = false;
|
||||
this.question.active = true; // 显示问号,表示加载中
|
||||
this.url = path;
|
||||
|
||||
let imgPath = this.url;
|
||||
@@ -94,6 +92,7 @@ export class DetailImageItem extends Component {
|
||||
imgPath = this.url + "_thumbnail";
|
||||
}
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, imgPath, "Chat18x", () => {
|
||||
this.question.active = false; // 图片加载成功后隐藏问号
|
||||
this.scaleToFillItem();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user