Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add a logo to header -bar in ionic

I am trying to add a logo in the center of my header bar using Ionic. Any advise on how to do it?

Here is my code

<ion-nav-bar class="bar-light">
<!--Logo-->
<ion-nav-buttons >
<img class="title" src="https://s3-us-west 2.amazonaws.com/s.cdpn.io/139144/sp_symbol_option2_1.png">
</ion-nav-buttons>
<ion-nav-buttons side="left">
<!--Left icons-->
<button class="button button-icon button-clear ion-navicon" ng-click="toggleLeft()"> 
</button></ion-nav-bar>
like image 614
Sage Avatar asked Apr 26 '14 22:04

Sage


People also ask

How do you add a header in ionic?

Adding Header If you want to create a header, you need to add bar-header after your main bar class. Open your www/index. html file and add the header class inside your body tag. We are adding a header to the index.

How do I hide the header in ionic?

Simply there is the attribute hide-nav-bar set to "true" on <ion-nav-view> element and on each <ion-view> .


1 Answers

How about doing something like this:

<ion-header-bar align-title="center" class="bar-positive">
  <div class="buttons">
    <button class="button" ng-click="doSomething()">Left Button</button>
  </div>
  <h1 class="title"><img class="title-image" src="http://www.ionicframework.com/img/ionic-logo-white.svg" width="123" height="43" /></h1>
  <div class="buttons">
    <button class="button">Right Button</button>
  </div>
</ion-header-bar>

You can have a look at this plunker as well.

Some extra info in their forum.

like image 167
LeftyX Avatar answered Oct 08 '22 18:10

LeftyX