Android : Showing keyboard hides listview contents

送分小仙女□ 提交于 2019-12-12 08:07:20

问题


like in this post : Keyboard hides ListView contents

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

but

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

Thanks


回答1:


I had the same issue and solved this with the below code.

in your activity:

mylistview.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
mylistview.setStackFromBottom(true);

or in xml file for

android:stackFromBottom="true"
    android:transcriptMode="normal"

and keeping the adjustResize for activity in manifest file.

<activity .... android:windowSoftInputMode="stateHidden|adjustResize" ..../>

Source: Push Listview when keyboard appears without adjustPan



来源:https://stackoverflow.com/questions/17790179/android-showing-keyboard-hides-listview-contents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!