0

I have two linearlayout one is below the other as below:

<LinearLayout
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center"
        android:id="@+id/linearLayout">

        <ImageView
            android:id="@+id/reg_imageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:srcCompat="@drawable/z"/>

        <TextView
            android:id="@+id/reg_app_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/app_title"
            android:textSize="20sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical"
        android:layout_marginRight="0dp"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginLeft="0dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_marginBottom="0dp"
        android:layout_marginTop="0dp"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout">

        <EditText
            android:id="@+id/req_number"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:ems="10"
            android:hint="@string/request_number"
            android:inputType="number" />

Here is the picture of the layout:

before the soft keyboard

when the keyboard shows, the layout get missed up:

when the keyboard shows

What is causing this issue?

NOTE: I have app:layout_constraintTop_toBottomOf="@+id/linearLayout" line in the .xml file that holds the EditText that requires the (Request number)

Behrouz Riahi
  • 1,751
  • 2
  • 21
  • 42
  • Possible duplicate of [Android: How do I prevent the soft keyboard from pushing my view up?](https://stackoverflow.com/questions/4207880/android-how-do-i-prevent-the-soft-keyboard-from-pushing-my-view-up) – Mr. Negi Jun 20 '17 at 20:42

1 Answers1

2

in manifest for this activity put

android:windowSoftInputMode="adjustNothing"
akshay_shahane
  • 4,423
  • 2
  • 17
  • 30