In ionic, I need to use 'Heading'(Large one) and 'Sub-heading'(smaller one). I am using like following,
<ion-view view-title="Primary Heading">
<ion-content>.....</ion-content>
</ion-view>
This is working. But, I need to use two headings. One as 'Primary heading' and another one as 'Sub-heading'. I tried to use 'header-bar', 'sub-header-bar'. But, it is not working as I expected. Heading should be in first line and sub-heading should be in next line. I also tried with
<ion-nav-title>...</ion-nav-title>
So, how to achieve this one. And also I have to apply my own styling for Headings. Please, help me out.
I think you are looking for a tab solution with subheader. The first header is set by the <ion-view>
as you mentioned. The subheader can be set with <ion-header>
.
<ion-view title="Primary Heading">
<ion-header-bar class="bar bar-subheader">
<h1 class="title">Subheader</h1>
</ion-header-bar>
<ion-content>
CONTENT
</ion-content>
</ion-view>
See next CodePen: http://codepen.io/calendee/pen/keHnw
After trying out, My answer for my question is,
<ion-view>
<ion-nav-title>
<div class="page-title">HEADING</div>
<div class="page-sub-title">Sub Heading</div>
</ion-nav-title>
<ion-content>.....</ion-content>
</ion-view>
And to apply style, my CSS would be like this,
.page-title{
margin-top : -10px;
color: #ffffff;
font-size: 1.5em;
}
.page-sub-title{
margin-top: - 25px;
color: green;
font-size : .9em;
}