Android : Showing keyboard moves my components up, i want to hide them instead

前端 未结 2 1721
梦毁少年i
梦毁少年i 2020-12-23 08:47

I have added a LinearLayOut having some buttons My screen is RelativeLayOut it self

Here is the code for that linear layout manager



        
相关标签:
2条回答
  • 2020-12-23 09:28

    You probably want

    <activity
         ...
       android:windowSoftInputMode="adjustNothing"> 
    </activity>
    

    That will prevent any layout changes when the soft keyboard is shown.

    There is probably some confusion over this since it's currently missing from the documentation at http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

    0 讨论(0)
  • 2020-12-23 09:37

    Add android:windowSoftInputMode="adjustPan" to manifest - to the corresponding activity:

      <activity android:name="MyActivity"
        ...
        android:windowSoftInputMode="adjustPan"
        ...
      </activity>
    
    0 讨论(0)
提交回复
热议问题