ionic-pullup icon indicating copy to clipboard operation
ionic-pullup copied to clipboard

How to set height dynamically

Open naveenkumarkg19 opened this issue 7 years ago • 3 comments

I am using it in ionic 2 , everything works fine . but at one page i need to set it to half page of the screen . How is it possible . I was able to achieve partially by removing ion-content and placing the ion-grid . nothing seems to be perfect . any idea ?

naveenkumarkg19 avatar Aug 30 '17 07:08 naveenkumarkg19

@naveenkumarkg19 You could use the maxHeight property:

<ion-pullup (onExpand)="footerExpanded()" (onCollapse)="footerCollapsed()" [(state)]="footerState" [maxHeight]="getMaximumHeight()">

Then in your code simply calculate the window height:

getMaximumHeight() {
    return window.innerHeight / 2;
}

I just tried it and it works.

arielfaur avatar Aug 31 '17 14:08 arielfaur

Thank You Some Much For This, You Saved Me So Much Time, I Just Wanted To Let You Know I Really Appreciate This Sire!

PandaBearz avatar Feb 06 '18 23:02 PandaBearz

Thank you so much... I have spend 3 hours googling for this....

jobintweets avatar Apr 04 '18 20:04 jobintweets