SoftInputMode in fragments

I have a NavigationDawer with some fragments that contain EditText s. When I β€œopen” a fragment, the layout is beautiful (ie Not crushed), but when I bring the keyboard, the layout becomes crushed.

I searched and added this to the manifest:

 <activity android:name=".Navigation_Drawer" android:label="@string/app_name" android:windowSoftInputMode="adjustResize" > // This being the important part <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

Since the navigation box is the only activity that contains / runs these fragments, the softInputMode fragment should be controlled by the action, but this code does not matter.

thanks

+4
source share
2 answers

Remove the code:

android:windowSoftInputMode="adjustResize"

from manifest file.

+3
source

Have you tried configuring windowSoftInputMode to configure Pan?

adjustResize will resize the activity to enable the keyboard, and that is the behavior you experience. If you set the windowSoftInputMode parameter to Pan, the action will be β€œmodified” or moved up to make room for the keyboard.

 android:windowSoftInputMode="adjustPan" 
+2
source

Source: https://habr.com/ru/post/1489643/


All Articles