[英]Can I define ion-title outside ion-navbar (i.e. in ion-content) with ionic2?
[英]Can I reset ion-content height on button click?
我可以在单击按钮时重置离子含量滚动高度吗? 我需要在单击按钮时切换页脚,但内容高度保持不变
就像您在内容文档中看到的一样:
调整大小()
告诉内容重新计算其尺寸。 这应该在动态添加/删除页眉、页脚或选项卡后调用。
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
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.