2017-03-07 45 views
4

预定义的手机功能:当我们专注于任何输入时,它将自动滚动到移动设备中的输入。当手机输入焦点时,无法滚动输入离子应用程序

问题:由于水平滚动也在那里,所以当我点击移动设备上的输入时,它不会自动滚动到输入和输入隐藏在键盘后面。

我试过delegate-handle这个,但它不工作。

Plunker为同一

HTML

<ion-scroll direction="xy" class="scroll" delegate-handle="nomineeDiv"> 
    <div class="table-row" ng-repeat="data in nominee"><!-- Multiple div show horizontally --> 
     <form name="data.formName"> 
      <!-- Long vertical form 
      ..... 
      ..... 
      after 4 input tags --> 
      <input type="text" name="something"/> 
      <!-- Need to scroll to input when input focused --> 
     </form> 
    </div> 
</ion-scroll> 

控制器

$ionicScrollDelegate.$getByHandle('nomineeDiv').scrollBy(580, 140, true); 
+0

可你只是验证我做到了那是你的方式或不http://keepnote.cc/3331328 –

+0

确定。只需检查设备。我点击上一个输入页面向上滚动并聚焦。该文本框的键盘顶端.http://prntscr.com/entaf1 –

+0

我检查它像打开应用程序滚动垂直,并单击上一个窗体文本框键盘打开,但页面滚动,并开始正确的?那是你面临的问题? –

回答

1

Solution.1你可以尝试创建上改变形式的位置双击事件是静态的。这可能会将您的页脚置于最高位置。

解决方案.2使用CSS在表单上应用overflow-y: scroll;

解决方案3您还可以尝试删除config.xml文件中的首选项<preference name="fullscreen" value="true" />

我有同样的问题,我解决它使用Solution.2

这里是一个链接 - Keyboard Hiding Inputs Problem