2016-11-23 95 views
0

我想在android屏幕下的ios下导航栏下为我的屏幕顶部制作一个固定的搜索栏。搜索栏不显示在Ionic上

我使用的文档:http://ionicframework.com/docs/v2/api/components/searchbar/Searchbar/

离子版本:2.1.12

但我的搜索栏没有显示。

我的代码:

HTML:

<ion-view title="Search" id="page3" hide-nav-bar="isAndroid"> 
    <div class="bar bar-subheader bar-positive item-input-inset" no-tap-scroll="true"> 
     <ion-searchbar 
      [(ngModel)]="search" 
      [showCancelButton]="shouldShowCancel" 
      (ionInput)="handleSearch($event)"> 
     </ion-searchbar> 
    </div> 
    <ion-content has-header="true" padding="true"> 
     <ion-list> 
      <ion-item ng-repeat="doc in documents" item="doc"> 
      </ion-item> 
     </ion-list> 
    </ion-content> 
</ion-view> 

截图:

Screenshot

正如你可以看到没有出现搜索栏...

我试图把它在我的意见中的其他组件之间,但它不会出现e ither。文档没有解释关于此主题的任何内容。非常令人沮丧

回答

0

http://plnkr.co/edit/dPsGZjczRSNpqmMDqLZQ?p=info

这是你提供的,如果您删除的所有plunker标签<br/>你会看到搜索栏是标题后面猛的代码。

enter image description here

所以加入style="z-index:999999999999"(只是要确定)的<ion-searchbar>导致此plunker:

http://plnkr.co/edit/JE1Vm47ehXsmkp5s9PGZ?p=info

enter image description here

+0

难道是这个简单,我可能不得不它想通了,但它不是这...不幸的是 –

+0

@HelderJulesDeBaere然后发布更多的代码请,这是你的代码的解决方案发布。 – Ivaro18

相关问题