In my activity's view I have RelativeLayout
in which there are two layouts: LinearLayout-"ll" (must be top of the screen) and Relative one - "rl"(must be bottom of screen). When I'm focusing on editText in the ll it opens keyboard and my rl ascends and shows on the ll. Then I try to use android:layout_below="@+id/ll"
but it didn't worked. Also I tried to add android:windowSoftInputMode=""
with various parameters in manifest but nothing helped.
SO How to keep RelativeLayout "rl" bottom of the screen even when keyboard opens?
Here is the code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="@dimen/main_container_padding"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xxx="http://schemas.android.com/apk/res-auto" >
<!-- Layout of username, password, Sign in button -->
<LinearLayout
android:id="@+id/llusernamePassLogin"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal" >
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="@string/loginPageText" />
<am.bs.xxx.view.EditTextBase
android:id="@+id/login_vcardnumber"
android:layout_width="fill_parent"
android:layout_height="@dimen/edit_text_height"
android:layout_margin="@dimen/edit_text_margin"
android:hint="@string/email"
android:inputType="text" />
<am.bs.xxx.view.EditTextBase
android:id="@+id/login_password"
android:layout_width="fill_parent"
android:layout_height="@dimen/edit_text_height"
android:layout_margin="@dimen/edit_text_margin"
android:hint="@string/password"
android:inputType="textPassword" />
<Button
android:id="@+id/signin"
style="@style/main_button"
android:layout_width="fill_parent"
android:layout_height="@dimen/edit_text_height"
android:layout_margin="@dimen/edit_text_margin"
android:background="@drawable/main_button_shape_selector"
android:onClick="createButtonClickListener"
android:text="@string/signIn" />
</LinearLayout>
<!-- Create VCard or Register layout -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:layout_marginBottom="40dp"
android:layout_below="@+id/llusernamePassLogin" >
<!-- Register button -->
<LinearLayout
android:id="@+id/llRegisterButtonLayout"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:paddingBottom="1dp"
android:gravity="center_horizontal"
android:paddingRight="10dp" >
<ImageButton
android:id="@+id/login_register_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/reg"
android:onClick="createButtonClickListener"
android:background="@color/transparent" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/registration" />
</LinearLayout>
<!-- Create VCard button -->
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/llRegisterButtonLayout"
android:paddingBottom="1dp"
android:gravity="center_horizontal" >
<ImageButton
android:id="@+id/create_vc_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/create_vcard"
android:onClick="createButtonClickListener"
android:background="@color/transparent" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/createVcard" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
It looks like you need android:windowSoftInputMode="adjustResize" and mark your root RelativeLayout as isScrollContainer=true
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