Reputation: 12044
I am struggling to add subheader into tabs based Ionic application. The problem is that the subheader is not shown in Android, but it is shown in iOS.
I want to use subheader for a search bar, so that it is not scrolled away with content bellow it.
Steps to reproduce the issue:
ionic start subheader-test tabs
.\subheader-test\www\templates\tab-dash.html
to add subheader on Status tab so that it looks like the file bellow:<ion-view view-title="Dashboard">
<ion-header-bar class="bar-subheader bar-balanced">
<h1 class="title">Subheader</h1>
</ion-header-bar>
<ion-content class="padding">
<h2>Welcome to Ionic</h2>
<p>
....
</p>
</ion-content>
</ion-view>
ionic serve -l
I tested ion-content
with combinations of has-subheader
and has-header
classed but it was to no avail.
Subheader is not show in Android version of the app in any browser I tested (Chrome, Firefox, IE 11).
Upvotes: 0
Views: 980
Reputation: 1
It didn't quite work for me. I had to delete the "has-tabs-top"
class from the subheader CSS to get it to work (looking in the Chrome console, that class was not assigned to the subheader when running ionic serve --lab)
Upvotes: 0
Reputation: 3126
This may solve the problem:
www/css/style.css
.platform-android .bar-subheader.has-tabs-top{
top:93px !important;
}
.platform-android .has-subheader.has-tabs-top{
top:137px;
}
Or maybe you can add $ionicConfigProvider.tabs.position('bottom');
in app.js like this:
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$ionicConfigProvider.tabs.position('bottom');
//
}
Upvotes: 1