【发布时间】:2017-12-25 14:30:08
【问题描述】:
我可以在按钮单击时重置离子含量滚动高度吗?我需要在按钮单击时切换页脚,但内容高度保持不变
【问题讨论】:
-
我可以隐藏页脚,但“滚动内容”边距底部没有重置
标签: angular typescript ionic2 ionic3
我可以在按钮单击时重置离子含量滚动高度吗?我需要在按钮单击时切换页脚,但内容高度保持不变
【问题讨论】:
标签: angular typescript ionic2 ionic3
就像你在Content docs看到的一样:
调整大小()
告诉内容重新计算其尺寸。 这应该 在动态添加/删除页眉、页脚或标签后调用。
import { Component, ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';
@Component({...})
export class MyPage{
@ViewChild(Content) content: Content;
public showFooter: boolean = true;
hideFooter() {
this.showFooter = false;
this.content.resize(); // Tell the content to recalculate its dimensions
}
showFooter() {
this.showFooter = true;
this.content.resize(); // Tell the content to recalculate its dimensions
}
}
【讨论】: