I have a side-menu controller that encompasses the entire contents of my app.
Inside I have header-bar, however under that header-bar I want to have a sub-header.
This is my code:
<side-menus>
<!-- Center content-->
<pane side-menu-content nav-router>
<!-- Define the header bar that will display todays date-->
<header-bar
title="headerTitle" left-buttons="leftButtons"
right-buttons="rightButtons" type="bar-stable"
aligh-title="center"
ng-controller="headerController"></header-bar>
<!-- Subheader will display the control to select when we want to leave-->
<div class="bar bar-subheader">
<button class='button button-clear ion-ios7-arrow-left'></button>
<h2 class="title">sub header</h2>
<button class='button button-clear ion-ios7-arrow-right'></button>
</div>
<!--Define where the content will be shown -->
<content has-header="true" ng-controller="contentController" on-refresh="onRefresh()" has-bouncing="true" padded="true">
<!-- for pull to refresh-->
<refresher></refresher>
<!-- main content view-->
<ng-view></ng-view>
</content>
</pane>
<!-- left menu-->
<side-menu side="left">
</side-menu>
</side-menus>
The issue this causes, is that the sub header overlaps the contents of the <ng-view> tag, forcing me to put a margin-top. However this is not an optimal solution, and it would be better if the sub header pushed the contents down instead of overlapping it.
Yeah it would be nice, the only reason I know of it was because it went digging in the css and saw a has-subheader class. You could always make a pull request on github to add it…
Two things I would change, mention that you must have the “has-header” option set to true in order for sub-header to work. Also, change padded to padding. Padded doesn’t work but padding does.
That did fix the list display issue, thanks! However, I have a left and right side menu (left for navigation, right for notifications). Adding this to the right side menu, now adds a header space to the left navigation that I don’t want :-(.
So in beta1 we should use now ion-header-bar for both headers and sub headers? that was the only way i could get the padding for the list below work correctly.
I’m using the tabs example app as starter. And I was struggeling to get my header showing.
Just using the starter app and included a header above the navbar.
The nav-bar was displayed on top of it. But after reading this topic and adding bar-subheader class to the ion-nav-bar and has-header and has-subheader to the ion-content everything is displaying correctly.
Except the tab names are not beeing displayed in the navbar anymore.
Am I missing something?
hmm kinda feared that, @mhartington
So if I want to display something above everything else including the nav bar and at all time. I can use a header and put the nav-bar in the ion-view? Or is there another way or another element I can use?
The app is used to start and stop processes and I want to show which proces is running at all time.