It appears that adjustPan
is actually panning on the baseline of my EditText
rather than the actual edge of the view.
I've been searching for a way to fix this, but I just haven't been able to find anything.
Activity code (kotlin):
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
window.setSoftInputMode(SOFT_INPUT_ADJUST_PAN)
}
Layout xml:
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.foo.testbed.MainActivity">
<EditText
android:id="@+id/myEditText"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="15dp"
android:layout_marginStart="8dp"
android:background="@drawable/rounded_edit_text"
android:hint="Message"
android:paddingStart="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/myButton"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/myButton"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:text="Send"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/myEditText" />
I have attempted solutions from the following questions to no avail: