I'm attempting to create an activity with a couple of TextInputEditText elements. These are placed about half way down the page, causing them to be covered by the keyboard when it appears. As such, I'm trying to use windowSoftInputMode="adjustPan" inside the AppManifest.xml to have the screen scroll to keep the text boxes in view when typing.
However, all attempts at this seem to be failing. Below is the layout hierarchy I'm using, followed up some examples of solutions I've already attempted to no avail.
layout xml
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:fillViewport="true"
android:isScrollContainer="false">
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:id="@+id/inputA"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/inputAText"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/inputB"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/inputBText"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.TextInputLayout>
</android.support.constraint.ConstraintLayout>
</ScrollView>
AndroidManifest.xml snippet
<activity
android:name=".activities.MyActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="sensorPortrait"
android:theme="@style/AppTheme.NoActionBar" />
Attempted Solutions
- Add
windowSoftInputMode="adjustPan"to the relevantactivityinAppManifest.xml(I have also triedadjustResizeandadjustPan|adjustNothingas according to other StackOverflow suggestions) - Place the
ConstraintLayoutinside aScrollView - Add
android:isScrollContainer="false"to said ScrollView - Recreate the layout file with only a
ConstraintLayoutandTextInputEditTextconstrained to the bottom of said layout - Change
TextInputEditTexttoEditTextand removeTextInputLayout - Changed
ConstraintLayouttoRelativeLayout
For what should be a fairly simple implementation I'm at a loss. Any further suggestions are appreciated. I'm happy to provide more code samples if necessary.