Ionic framework 爱奥尼亚:专注于子标题上的输入字段使键盘隐藏列表元素
我正在处理一个Ionic项目,在我们的一个视图中,在子标题中有一个输入字段。使用此输入字段,用户可以搜索离子列表中显示的其他用户 我遇到的问题是,当键盘出现时,它实际上隐藏了离子列表的一部分。在阅读了Ionic文档中的键盘文档后,我认为问题是由于子标题输入字段和ion列表不是同一可滚动区域的一部分造成的 我有办法解决这个问题吗 以下是守则的相关部分:Ionic framework 爱奥尼亚:专注于子标题上的输入字段使键盘隐藏列表元素,ionic-framework,ionic,soft-keyboard,input-field,Ionic Framework,Ionic,Soft Keyboard,Input Field,我正在处理一个Ionic项目,在我们的一个视图中,在子标题中有一个输入字段。使用此输入字段,用户可以搜索离子列表中显示的其他用户 我遇到的问题是,当键盘出现时,它实际上隐藏了离子列表的一部分。在阅读了Ionic文档中的键盘文档后,我认为问题是由于子标题输入字段和ion列表不是同一可滚动区域的一部分造成的 我有办法解决这个问题吗 以下是守则的相关部分: <ion-header-bar align-title="left" class="bar-light bar-subheader item
<ion-header-bar align-title="left" class="bar-light bar-subheader item-input-inset">
<div class="item-input-wrapper">
<i class="icon ion-ios-search placeholder-icon"></i>
<input type="search" placeholder="Search" ng-model="searchUsers" ng-change="showUsersSuggestions($event);" ng-focus="enableSearch(true)" ng-blur="enableSearch(false)">
<button class="button button-clear clear-search icon ion-ios-close-empty" ng-click="clearSearch()"></button>
</div>
</ion-header-bar>
<ion-content>
<ion-list can-swipe="true" ng-if="showSearchResults">
<ion-item class="item item-divider list-result" style="border-top:0;">
Search results
</ion-item>
<ion-item class="item item-avatar item-icon-right item-text-wrap list-result" ng-show="searchUsers && searchUsers.length >= 3 && usersSuggestions" ng-repeat="f in usersSuggestions">
<img ng-src="{{getAvatarUrl(f)}}" width="40" height="40" ng-click="showProfileInfo(f)">
<h2 ng-show="f.displayName" ng-click="showProfileInfo(f)">{{f.displayName}}</h2>
<p ng-click="showProfileInfo(f)">{{f.email}}</p>
</ion-item>
</ion-list>
......
</ion-content>
搜索结果
{{f.displayName}}
{{f.email}
......
我发现解决这个问题的唯一方法是在内容触摸事件中关闭键盘
<ion-content class="has-subheader" on-touch="hideKeyboard()">
...
</ion-content>
scope.hideKeyboard = function() {
$cordovaKeyboard.close()
};
...
scope.hideKeyboard=函数(){
$cordovaKeyboard.close()
};
。。。
我刚刚添加了这个带有键盘连接的div。爱奥尼亚的文档说键盘连接只对一个页脚有效,但对我有效。我在iOS9上进行了测试 你解决了这个问题吗,兄弟?
...
</ion-content>
<div keyboard-attach>
</div>
</ion-view>