当键盘出现时,Ionic的ion-content未能正确调整

8

我有一个使用textangular作为元素的视图。在Android(我测试过),如果键盘打开,视图不会向上滚动以防止编辑器被键盘遮挡。 我安装了Keyboard插件com.ionic.keyboard。

这是页面的结构:

<ion-view id="newblogview">
    <ion-nav-buttons side="left">
    ...
    </ion-nav-buttons>    
  <ion-content scroll="true" overflow-scroll="true" class="has-header" delegate-handle="mainScroll">  
     <iframe data-tap-disabled="true" style="width: 100%; min-height: 100%"  src="./templates/blog/html/blog-editor.html" name="blogeditor" id="blogeditor"></iframe>                
  </ion-content>
</ion-view>

当键盘聚焦在输入框上时,它没有上移。我尝试了android:windowSoftInputMode="adjustPan"和"adjustResize",并且还尝试了native.keyboardshow事件来调用$ionicScrollDelegate.scrollBottom(true)。
我认为我们有一个键盘附加指令用于页脚,但我无法将文本编辑器放置在页脚中。Ionic框架是否支持调整ion内容以响应键盘的显示/隐藏?这个功能在框架中是否不受支持,或者我漏掉了什么?
这个问题类似于另一个线程,但没有被接受的答案。
请帮忙。 - Prakash.
1个回答

0

您可以将此添加到您的HTML组件中

<div delegate-handle="toThisPosition" ng-click="GoHere()"> </div>

并将其添加到您的控制器中的ng-click方法GoHere()中:

GoHere() {
$ionicScrollDelegate.$getByHandle('toThisPosition').scrollBottom(true);
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接