What is the idiomatic way to create a pair of Cancel and Done sticky bottom buttons that take up full width? Here is an example:
I don’t see a way to do without a hacky CSS. I don’t see a way to do declaratively here ion-button: Ionic Framework API Docs
Any ideas?
have you tried using IonFooter? and removing the padding and margin around the buttons?
D’oh! Thank you–but I assume that can’t be used if I have bottom tab nav, or can it? I will try. My use case is modal, so footer should work fine.
So, footer doesn’t work on pages that already have a tab nav footer. Any tips on a non-hacky way to stack it above the bottom tab primary nav?
put this after the </ion-content>
but before </ion-page>
<div style="display: grid; grid-auto-flow: column; grid-gap: 0px;">
<ion-button expand="full" style="margin: 0px; padding: 0px"
>AT BOTTOM</ion-button
>
<ion-button
expand="full"
style="margin: 0px; padding: 0px"
color="danger"
>AT BOTTOM ALSO</ion-button
>
</div>
One last thing–the buttons hang around until after the exit screen transition is completed, so that they appear on the next screen as it loads and then disappear. Any tips on how to make them disappear with the rest of their page? I could set flags on Ionic lifecycle hooks but wondered if less hackyish way?
Actually, using ionViewWillLeave()
works fine to hide the footer buttons on exit. It doesn’t animate with the exiting screen but it is barely noticeable.