2017-07-20 3 views
1

ボタンのクリックでイオン含有量スクロールの高さをリセットできますか?私は、ボタンのクリックでフッターを切り替える必要がありますが、コンテンツの高さは、あなたがContent docsで見ることができると同じように同じボタンのクリックでイオン含有量の高さをリセットできますか?

+0

私はフッターを非表示にしますが、「スクロール・コンテンツを」マージン下、この問題を解決するためにあなたができる – Sijith

+0

をリセット取得できませんでしたか? – sebaferreras

答えて

1

まま:

リサイズ()

その寸法を再計算するためにコンテンツを知らせます。 ヘッダー、フッター、またはタブを動的に追加/削除した後に呼び出す必要があります。

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 
    } 
} 
+1

@sebaferrerasありがとうございました – Sijith

+1

答えが@Sijithを助けてくれたことを嬉しく思っています:) – sebaferreras

関連する問題