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:
Solution is to set a top&bot paddings
My example with editText:
<AutoCompleteTextView
android:id="@+id/editText_new_password"
android:layout_width="match_parent"
android:layout_height="@dimen/btn_editbox_height"
android:background="@drawable/edit_text_style"
android:gravity="center_vertical"
android:paddingEnd="@dimen/login_edit_box_pass_padding_right"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingStart="@dimen/edit_box_padding"
android:textSize="14sp" />
with paddings 12:
and naked paddings:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With