繁体   English   中英

我可以在单击按钮时重置离子含量高度吗?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM