0

I have a RelativeLayout in which at the top I have an EditText and at the bottom I have an next Button.. when I click the EditText I want the next Button to appear above the keyboard.. I have use the adjust panel in Manifiest but still it does not work

 <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <com.alimuzaffar.lib.pin.PinEntryEditText
            android:id="@+id/txt_pin_entry"
            android:focusable="true"
            android:layout_below="@+id/tv_phoneno_otp"
            android:layout_marginTop="@dimen/margin_top_otp_small"
            android:layout_width="@dimen/otp_dimen"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/margin_left_otp"
            android:cursorVisible="true"
            app:pinLineColors="@color/colorPrimary"
            android:digits="1234567890"
            android:inputType="number"
            android:maxLength="4"
            android:textIsSelectable="true"
            android:textSize="20sp"
            android:layout_marginStart="@dimen/margin_left_otp" />


   <Button
            android:id="@+id/btn_next_btn_otp"
            android:layout_width="@dimen/min_width"
            android:layout_height="@dimen/min_width"
            android:layout_alignParentRight="true"
            android:background="@drawable/back_btn"
            android:layout_marginRight="@dimen/margin_left_button_login"
            android:layout_marginEnd="@dimen/margin_left_button_login"
            android:layout_alignParentEnd="true"
            android:layout_below="@+id/txt_pin_entry"
            android:layout_marginTop="@dimen/margin_small_text_sub"/>


</RelativeLayout>
ankuranurag2
  • 2,300
  • 15
  • 30
jin
  • 53
  • 8
  • I'm assuming this isn't your full layout? It looks like your `PinEntryEditText` has the attribute `android:layout_below="@+id/tv_phoneno_otp"` but that view doesn't exist. – D Ta Jan 23 '19 at 19:38
  • Hey what you have added in manifest file ? – vishva kapadia Jan 24 '19 at 04:55

1 Answers1

0

In the Android Manifest, give the property android:windowSoftInputMode="adjustResize". This will resize your layout when keyboard shows.

Like this :

<activity
        android:name=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="adjustResize">
    </activity>
milad salimi
  • 1,580
  • 2
  • 12
  • 31