'Android- Why 'adjustPan' on windowSoftInputMode doesn't work ? Anyone knows why?
Problems
Hey guys, I'm currently working on creating some IOS and Android app using React Native. And I'm struggling to fix the keyboard + screen issue on Android devices.
As you can see in the left picture, the keyboard hides another inputs so the users can't see below parts.(and the screen is not scrollable.. either)
Attempt
To resolve this, I implemented ' android:windowSoftInputMode="stateAlwaysHidden|adjustPan" , but it doesn't work. I don't know why...
Moreover I saw a lot of answers that 'ScrollView' must be implemented or used. I tried in manifest.xml file, but I got errors.
Can you guys explain what the issue is and advise me how I can resolve this issue? Thanks in advance.
P.S => This issue doesn't happen in IOS device.... it only happens in Android..
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="anonymous">
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="true"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
MainActivity.java
package anonymous;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "my_app";
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

