How to hide ionic tabs on sub pages

How to hide ionic tabs on sub pages

If you have hard time to find solution for hiding tabs in Ionic framework 4/5 here is simplest solution for you.

Open your page .ts file (page that you don't want to show tabs on it)

then place this code in constructor part.

const tabs = document.querySelectorAll('ion-tab-bar');
  Object.keys(tabs).map((key) => {
    tabs[key].style.display = 'none';
});

Your final code will be like this:

constructor() {
    const tabs = document.querySelectorAll('ion-tab-bar');
    Object.keys(tabs).map((key) => {
      tabs[key].style.display = 'none';
    });
}

Screenshots of results

- Last updated 11 months ago

Be the first to leave a comment.

You must login to leave a comment