键盘显示时,离子离子含量不会向下滚动(Android) [英] Ionic ion-content not scrolling down when keyboard shows (Android)

查看:200
本文介绍了键盘显示时,离子离子含量不会向下滚动(Android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的视图与登录表单。在Android上,如果键盘已打开,则内容不会向上滚动,以防止其进入键盘。



我按照文档中的键盘说明操作,很多论坛帖子,但我没有想出来。



我安装了键盘插件 com.ionic.keyboard



这是页面的结构:

 < ion-nav-view> 
< ion-view>
< ion-content>
...< form> ..登录表单..< / form> ...
< / ion-content>
< / ion-view>
< / ion-nav-view>

如果我在页面中添加一些额外的虚拟内容,它显示离子内容确实是可滚动的。




  • 离线版本? 1.0.0-beta.13

  • 我的应用程式是否全萤幕?否

  • 我测试了键盘插件是否正常工作?是

    方案


    在Android和iOS上,Ionic将尝试防止键盘
    遮住输入和可聚焦元素,当
    滚动到视图。为了这个工作,任何可聚焦的
    元素必须在一个滚动视图或一个指令,如内容
    有一个滚动视图。


    此处的文档描述


    I have a simple view with a login form. On Android, if the keyboard is opened, the content is not scrolling up to prevent it from getting behind the keyboard.

    I followed the Keyboard instructions from the docs, and read a lot of forum posts, but I haven't figured it out.

    I installed the Keyboard plugin com.ionic.keyboard.

    This is the structure of the page:

    <ion-nav-view>
      <ion-view>
        <ion-content>
           ...<form>..Login form..</form>...
        </ion-content>
      </ion-view>
    </ion-nav-view>
    

    If I put some extra dummy content in the page, it shows that ion-content is indeed scrollable. However, it's not moving up when the keyboard is opened by focusing on an input.

    • Ionic version? 1.0.0-beta.13
    • Is my app fullscreen? No
    • Did I test if the keyboard plugin is working? Yes

    Is there anything else I have to do?

    解决方案

    On both Android and iOS, Ionic will attempt to prevent the keyboard from obscuring inputs and focusable elements when it appears by scrolling them into view. In order for this to work, any focusable elements must be within a Scroll View or a directive such as Content that has a Scroll View.

    description from documentation here

    这篇关于键盘显示时,离子离子含量不会向下滚动(Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆