如何在Android中打开键盘时在视图中滚动?

如何在Android中打开键盘时在视图中滚动?,第1张

概述我在scrollview中有一些edittext,当它们超出屏幕容量时,当键盘打开时很难执行平滑滚动.这是我的代码.<ScrollViewandroid:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_par

我在scrollvIEw中有一些edittext,当它们超出屏幕容量时,当键盘打开时很难执行平滑滚动.这是我的代码.

     <ScrollVIEw    androID:layout_wIDth="match_parent"   androID:layout_height="match_parent"    >    <linearLayout         androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"         androID:orIEntation="vertical"       >        <EditText             androID:layout_wIDth="200dp"            androID:layout_height="wrap_content"            />        <EditText             androID:layout_wIDth="200dp"            androID:layout_height="wrap_content"            />        <EditText             androID:layout_wIDth="200dp"            androID:layout_height="wrap_content"            />        <EditText             androID:layout_wIDth="200dp"            androID:layout_height="wrap_content"            />        <EditText             androID:layout_wIDth="200dp"            androID:layout_height="wrap_content"            />    </linearLayout></ScrollVIEw>

如果有人知道,请指导我这个问题的良好链接或回答相同的问题.

谢谢

解决方法:

使用

 androID:focusable="true"         androID:focusableIntouchMode="true"

在线性布局内.

总结

以上是内存溢出为你收集整理的如何在Android中打开键盘时在视图中滚动?全部内容,希望文章能够帮你解决如何在Android中打开键盘时在视图中滚动?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1106523.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存