Image in nav bar in new Ionic versions


#1

Hi guys :smile:

So I think with the changes made to the framework, some of the examples on the forums are broken.

Can someone point me in the direction of adding a small image into my nav-bar?

My app is a tab app, so I figure I need to add something here:

<ion-tab title="Home" icon-off="ion-ios-pulse" icon-on="ion-ios-pulse-strong" href="#/tab/Kidzone">    
<ion-nav-view name="tab-Home"></ion-nav-view>
</ion-tab>  

I am just not 100% what :blush:

Thanks :smile:


#2

You can use ion-nav-title to add an image as the title of the ion-nav-bar. This can be a child of ion-nav-bar or ion-view, depending on which views you want the image to show on.

<ion-nav-bar>
</ion-nav-bar>
<ion-nav-view>
  <ion-view>
    <ion-nav-title>
      <img src="logo.svg">
    </ion-nav-title>
    <ion-content>
      Some super content here!
    </ion-content>
  </ion-view>
</ion-nav-view>