EditText, adjustPan, ScrollView issue in android

纵然是瞬间 提交于 2019-11-27 17:49:32

问题


I have a EditText which is enclosed in ScrollView, but when the keyboard comes up.

You can NOT scroll down to the fields that are now covered. I have tried adding adjustSize, adjustPan in the manifest and in the class.

But its not working..


回答1:


I was suffering from the same issue and I a found solution. So, maybe it will help you.

Please give following attributes to ScrollView tag:

android:isScrollContainer="false"

And in manifest of your activity to :

android:windowSoftInputMode="adjustPan"



回答2:


In your manifest file inside activity tag use

android:windowSoftInputMode="adjustResize|stateVisible|stateAlwaysHidden" 



回答3:


you just add this line in scrollview android:isScrollContainer="true"

Like something this

 <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:isScrollContainer="true"
        android:scrollbars="none">



回答4:


just struggled for 3 hours to fix this same problem.

What worked for me is to remove "adjustPan" from the windowSoftInputMode in the manifest.

So I went from :

android:windowSoftInputMode="adjustResize|adjustPan|stateHidden"

to:

android:windowSoftInputMode="adjustResize|stateHidden"

and it fixed everything for me.

I hope this helps anyone else that stumbles upon this too. Funny enough, on my other screens it all still works regardless of the adjustPan.



来源:https://stackoverflow.com/questions/21449152/edittext-adjustpan-scrollview-issue-in-android

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