EditText, adjustPan, ScrollView issue in android

后端 未结 4 1866
Happy的楠姐
Happy的楠姐 2020-12-15 22: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 cover

相关标签:
4条回答
  • 2020-12-15 22:52

    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"
    
    0 讨论(0)
  • 2020-12-15 22:52

    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">
    
    0 讨论(0)
  • 2020-12-15 23:07

    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.

    0 讨论(0)
  • 2020-12-15 23:11

    In your manifest file inside activity tag use

    android:windowSoftInputMode="adjustResize|stateVisible|stateAlwaysHidden" 
    
    0 讨论(0)
提交回复
热议问题