2017-05-04 1 views
0

ハイブリッドアプリにIonic2を使用しています。私はコンテンツ領域(イオン含有量)の高さ+幅が必要な要件を持っています。私はこれは私がconsole.log(this.content.getContentDimensions());Ionic2、コンテンツの幅と高さが0を示しています

をしようとすると、それは

{"contentHeight":null,"contentWidth":525,"contentLeft":0,"scrollHeight":1023,"scrollTop":0,"scrollWidth":510,"scrollLeft":0} 

どのように私は(イオン・コンテンツを取得することができますを与える0,0

を与えている

@ViewChild(Content) content: Content; console.log(this.content.contentWidth,this.content.contentHeight) をしようとしています

視認可能領域)幅と高さ。

答えて

0

ionViewDidLoad() { 

     setTimeout(() => { 
      console.log("some....",this.content.contentHeight); 
      this.contentHeight = this.content.contentHeight; 
      console.log("some....",this.contentHeight); 
     }, 10); 

    } 
...これを試してみてください
関連する問題