I chose the ionic tab view so I can use the templating system but I can't remove the tabs. I want a view like this and I did manage to remove the header bar but I cant remove the tabs bar
This is what I got so far:
If I hide the tabs bar (ion-tabs{display:none}
) it also removes the content, which is not what I want.
There is a simple way to implement that - moving the route you wish to hide the tab-bar to the tabs module, outside of tabs children routes. Moving this route to tabs routing module will hide tab-bar from the page.
If you want to hide the tabbar then do this line of code: tabs[key]. style. display = 'none';
All tabs can be changed by setting the value of tabsLayout on the <ion-tabs> element, or in your app's config. For example, this is useful if you want to show tabs with a title only on Android, but show icons and a title for iOS.
We can easily navigate between each view by clicking on the tab label. Each tab's label is shown in the ion-tab-bar and the active tab's label is designated with a different style. The Ionic tabs are mainly used for mobile navigation and we have to see tabs are commonly used at bottom of an application.
I know that this is answered already, but there's a more "angular way" of doing this that might be helpful. It's done by using a custom directive that you can apply on views that you don't want to show the bottom tab bar.
My solution to this on my app was:
1 - Use ng-hide
binded to a rootScope variable on the tab bar, so I can hide/show it in any Controller/View of my app:
<ion-tabs ng-hide="$root.hideTabs" class="tabs-icon-only">
<!-- tabs -->
</ion-tabs>
2 - Create a custom directive that, when present, will hide the tab bar (and will show the tab bar again when the view is destroyed/dismissed:
var module = angular.module('app.directives', []);
module.directive('hideTabs', function($rootScope) {
return {
restrict: 'A',
link: function($scope, $el) {
$rootScope.hideTabs = true;
$scope.$on('$destroy', function() {
$rootScope.hideTabs = false;
});
}
};
});
3 - Apply it to specific views that don't need the tab bar visible:
<ion-view title="New Entry Form" hide-tabs>
<!-- view content -->
</ion-view>
ps: I think this can be improved even further avoiding the need of the ng-hide
on the <ion-tabs>
declaration, letting the directive do all the "dirty work".
Have a look at the Ionic tab documentation:
To hide the tabbar but still show the content, add the "tabs-item-hide" class.
So you would change this:
<div class="tabs">
<a class="tab-item" href="#">
Home
</a>
...
</div>
to this:
<div class="tabs tabs-item-hide">
<a class="tab-item" href="#">
Home
</a>
...
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With