2015-10-19 66 views
0

我已经做了一个代码,以将图像和文本一起附加到离子视图的标题栏。这是代码片段:离子AngularJS:将图像和文本附加到离子视图的标题栏不显示

<ion-view align-title="left"> 
<h1 style="margin-left:100px" class="title"> 
<img class="title-image" src="http://www.ionicframework.com/img/ionic-logo-white.svg" width="123" height="43" /> 
</h1> 
<h1 class="title">Titled Text</h1> 
    <ion-content class="padding"> 
     <div class="list list-inset"> 
      <label style="border: 3px solid red; border-radius:5px;" class="item item-input"> 
       <input focus-on="focusMe" type="text" ng-model="register.username" placeholder="Choose username"> 
      </label> 
      <label style="margin-top: 10px; border: 3px solid red; border-radius:5px;" class="item item-input"> 
       <input type="password" placeholder="Choose password" ng-model="register.password"> 
      </label> 
     </div> 
     <a style="margin-top: 100px; border: 3px solid red; border-radius:5px; background-color: #ff6000 class="button button-block button-positive">Next</a> 
    </ion-content> 
</ion-view> 

这就是我所做的普拉克。

Plunker

请我怎样才能使图像和文字看起来离子视图的标题栏?

+0

问题是什么? – user1697575

+0

你的佣金完全损坏...... – Makoto

+0

这就是挑战。 – Blaze

回答

1

我做了一个小的演示给你,

Plunker

HTML

<ion-view title="Home" hide-nav-bar="true"> 
    <div class="bar bar-header bar-light"> 
     <h4>myApp</h4> 
     <div style="width:100%"> 
      <img style="height: 16px; 
     margin-top: 9px;" src="https://placehold.it/85x25" /> 
     </div> 
    </div> 
    <ion-content padding="true"> 
     <h1 style="text-align: center;">Welcome user</h1> 
    </ion-content> 
</ion-view> 
0

这是我的问题/挑战的解决方案。 因为我发现很难做这样的

<ion-view align-title="left"> 
<h1 style="margin-left:100px" class="title"> 
<img class="title-image" src="http://www.ionicframework.com/img/ionic-logo-white.svg" width="123" height="43" /> 
</h1> 
<h1 class="title">Titled Text</h1> 

东西添加图片和文字到了吧,然后我落得这样做的:

<ion-nav-buttons side="left"> 
    <img class="title-image" src=".../ionic-logo-white.svg" width="30" height="43" /></h1> 
</ion-nav-buttons> 
<ion-nav-buttons side="left"> 
    <button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button> 
</ion-nav-buttons> 

不知道是什么,你不妨考虑一下但它的工作。由于它在标题处放置了一个图像,而且在标题栏也有一个文本。只是一个简单的逻辑