Android:显示键盘隐藏listview内容 [英] Android : Showing keyboard hides listview contents
问题描述
就像这篇文章一样:键盘隐藏了ListView内容
当键盘"可见时,我看不到ListView的前几行的内容.
I can't See Contents of my first few rows of my ListView when Keyboard is Visible.
因为我的第一个问题是将我的元素放在底部,所以我按照以下提示操作:
Because my first probleme was to have my element in the bottom so i've follow this tips : Android : Showing keyboard moves my components up, i want to hide them instead
但是
android:windowSoftInputMode="adjustPan"
造成了另一个问题,键盘弹起时我的列表视图没有调整大小,并且我看不到前几行
created another issue, my listview is not resize when my keyboard is up and i can't see my first few rows
谢谢
推荐答案
我遇到了同样的问题,并使用以下代码解决了这个问题.
I had the same issue and solved this with the below code.
您的活动中:
mylistview.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
mylistview.setStackFromBottom(true);
或在
android:stackFromBottom="true"
android:transcriptMode="normal"
,并将 adjustResize
用于清单文件中的活动.
and keeping the adjustResize
for activity in manifest file.
<activity .... android:windowSoftInputMode="stateHidden|adjustResize" ..../>
来源:在出现键盘时按下Listview没有AdjustPan
这篇关于Android:显示键盘隐藏listview内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!