Ionic framework 如何在ionic中向标题栏添加徽标

Ionic framework 如何在ionic中向标题栏添加徽标,ionic-framework,Ionic Framework,我正在尝试使用Ionic在标题栏的中心添加徽标。有什么建议吗 这是我的密码 <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>

我正在尝试使用Ionic在标题栏的中心添加徽标。有什么建议吗

这是我的密码

<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>

这样做怎么样:

<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>

左键
右键
你也可以看看这个


一些额外的信息在他们的。

我只是通过以下方式做到了这一点:

在我的模板中


在我的控制器中
$scope.pageTitle=“”

考虑到您使用的是导航条,您应该使用离子导航标题。下面是一个例子:

<ion-nav-bar align-title="center">
</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>

这里有一些超级内容!

根据您的喜好更改图像高度和src:)

将所需图像放入应用程序的“www/img”文件夹中。然后使用下面的代码 在index.html中

<h1 class="title"><img class="title-image" src="img/mylogo.png" width="123" height="43" /></h1>

也可以执行以下操作:

<ion-view  id = "yourHeader">
    <ion-nav-title>
        <div id = "title">YOUR TITLE</div>
        <img src="img/Message.png" class = "peers_msg_img">
        <img src="img/Notification.png" class="peers_profile_img">
        <img src="img/Peers.png" class="peers_alert_img">
     </ion-nav-title>
     <ion-content>
       //Some Content
     </ion-content>
</ion-view>

你的头衔
//一些内容
以下指令是关键:

<ion-nav-title>

<ion-nav-title>