Always same Header


#1

Hi, first of all, greetings for the great job.

I have a question, is there any way to have the same header in all the views?.

Thank you a lot.


#2

build a base layout with ionnavbar and but your fixed content in there
http://ionicframework.com/docs/api/directive/ionNavBar/


#3

Hi @Ki1l3r
You can use sidemenu view as starter templete for your app. There is an main view as LAYOUT.
Start your app by command

ionic start sidemenu

And you can see the template source.


#4

another thing, is possible to have a header with two lines?


#5

Header and sub-header elements. Dont forget to add class=“has-header has-subheader” on your CONTENT element


#6

false… if you are using ionic correctly the classes are set automatically…


#7

thank you very much, I solved it doing this: say me if its ok please:

<ion-nav-title ng-click="mainRouter()">
          <div class="page-title">App</div>
          <div class="page-sub-title">{{date}}</div>
</ion-nav-title>

and styling them:

.page-title {
	height: 14px;
	line-height: 36px;
    text-align: center;

}

.page-sub-title {
	font-size: 11px;
	color: #459691;
    text-align: center;

}

#8

looks good.
Did you try any page-transition animation?

Does it work well?


#9

yes it works like a charm!