The height of the header / footer is set using ionic CSS to the classes .bar and .bar-footer respectively.
What can you do:
a) Override the .bar CSS class to specify the required height:
b) Use the built-in styles to set the height there:
<ion-header-bar align-title="left" class="bar-positive" style="height: 80px;">
In any case, I think that both options (fixed heights) are the right way, because otherwise you will not be able to correctly position the content or the stand.
There is a snippet of code with fixed heights (note the properties of the “top” and “bottom” CSS to match the new column heights).
angular.module('starter', ['ionic'])
.bar{ height: 80px !important; } .has-header{ top: 80px !important; bottom: 160px !important; } .bar-footer{ height: 100px !important; } .bar-subfooter{ bottom: 100px !important; height: 60px !important; }
<link href="http://code.ionicframework.com/1.1.1/css/ionic.min.css" rel="stylesheet"> <script src="http://code.ionicframework.com/1.1.1/js/ionic.bundle.min.js"></script> <body ng-app="starter"> <ion-view title="Bug tab"> <ion-header-bar align-title="left" class="bar-positive"> <h1 class="title">Header!</h1> <h2>more header</h2> <h2>more header</h2> </ion-header-bar> <ion-content has-header="true"> <h2>Content</h2> </ion-content> <ion-footer-bar class="bar-subfooter" class="bar-assertive"> <h1 class="title">Subfooter</h1> <h2>more subfooter</h2> <h2>more subfooter</h2> </ion-footer-bar> <ion-footer-bar align-title="left" class="bar-assertive"> <h1 class="title">Footer</h1> <h2>more footer</h2> <h2>more footer</h2> </ion-footer-bar> </ion-view> </body>
If you want the height to expand based on dynamic content , you can use the min-content height property, although in this case, since you won’t know before the tops of the header, footer and subclass, you won’t be able to set the correct CSS header / footer to the position of the absolute divs that require it (content and subtitle), so some of these divs will remain hidden by the header and footer elements.
Check the difference in the following snippet:
angular.module('starter', ['ionic'])
.bar{ height: -moz-min-content !important; height: -webkit-min-content !important; height: min-content !important; }
<link href="http://code.ionicframework.com/1.1.1/css/ionic.min.css" rel="stylesheet"> <script src="http://code.ionicframework.com/1.1.1/js/ionic.bundle.min.js"></script> <body ng-app="starter"> <ion-view title="Bug tab"> <ion-header-bar align-title="left" class="bar-positive"> <h1 class="title">Header!</h1> <h2>more header</h2> <h2>more header</h2> </ion-header-bar> <ion-content has-header="true"> <h2>Content</h2> </ion-content> <ion-footer-bar class="bar-subfooter" class="bar-assertive"> <h1 class="title">Subfooter</h1> <h2>more subfooter</h2> <h2>more subfooter</h2> </ion-footer-bar> <ion-footer-bar align-title="left" class="bar-assertive"> <h1 class="title">Footer</h1> <h2>more footer</h2> <h2>more footer</h2> </ion-footer-bar> </ion-view> </body>
source share