我正在尝试在我的屏幕顶部的android屏幕下方和ios的导航栏下面创建一个固定的搜索栏 .
我正在使用文档: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>
截图:
如你所见,没有搜索栏出现......
我尝试将它放在我的视图中的其他组件之间,但它也没有出现 . 文档没有解释这个问题 . 很沮丧
1 回答
http://plnkr.co/edit/dPsGZjczRSNpqmMDqLZQ?p=info
这是您提供的代码,如果您删除了plunker中的所有
标记,您将看到搜索栏被推到 Headers 后面 .所以在
<ion-searchbar>
中添加一个style="z-index:999999999999"
(只是为了确定)导致了这个plunker:http://plnkr.co/edit/JE1Vm47ehXsmkp5s9PGZ?p=info