Parent bottom views hide with parent center layout view on opening keyboard : <p>I am working on layout where I have aligned one <code>cardview</code> on the center of the screen and contact us <code>button</code> on bottom of the screen. This layout looks OK when keyboard is closed.</p>

<p>It looks like below :-<a href="https://i.stack.imgur.com/lzc61.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lzc61.png" alt="enter image description here"></a></p>

<p>layout.xml</p>

<pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"&gt;

        &lt;RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"&gt;

            &lt;LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:weightSum="2"&gt;

                &lt;ImageView
                    android:id="@+id/login_image"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@drawable/login_background" /&gt;

                &lt;View
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@color/grey_background" /&gt;

            &lt;/LinearLayout&gt;


            &lt;android.support.v7.widget.CardView
                android:id="@+id/media_card_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_marginLeft="24dp"
                android:layout_marginRight="24dp"
                card_view:cardBackgroundColor="@color/white"
                card_view:cardElevation="4dp"
                card_view:cardCornerRadius="5dp"
                &gt;

                &lt;RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"

                    &gt;

                    &lt;ImageView
                        android:id="@+id/logoImageView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:background="@color/grey_background"
                        android:padding="15dp"
                        android:src="@drawable/logo_login"
                        /&gt;

                    &lt;EditText
                        android:id="@+id/usertext"
                        android:layout_width="match_parent"
                        android:layout_height="40dp"
                        android:layout_below="@id/logoImageView"
                        android:layout_marginLeft="20dp"
                        android:layout_marginRight="20dp"
                        android:layout_marginTop="20dp"
                        android:background="@drawable/edittext_background"
                        android:hint="User ID"
                        android:maxLength="50"
                        android:padding="10dp"
                        android:singleLine="true"
                        android:textColorHint="@color/hint_text_color"
                        android:textSize="16sp" /&gt;


                    &lt;FrameLayout
                        android:id="@+id/passwordLayout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/usertext"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal"&gt;

                        &lt;EditText
                            android:id="@+id/passtext"
                            android:layout_width="match_parent"
                            android:layout_height="40dp"
                            android:layout_marginLeft="20dp"
                            android:layout_marginRight="20dp"
                            android:background="@drawable/edittext_background"
                            android:fontFamily="sans-serif"
                            android:hint="@string/password"
                            android:inputType="textPassword"
                            android:maxLength="50"
                            android:padding="10dp"
                            android:singleLine="true"
                            android:textColorHint="@color/hint_text_color"
                            android:textSize="16sp" /&gt;

                        &lt;ImageView
                            android:id="@+id/passwordeye"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="right|center_vertical"
                            android:padding="8dp"
                            android:layout_marginRight="25dp"
                            android:src="@drawable/eye_close" /&gt;

                    &lt;/FrameLayout&gt;

                    &lt;LinearLayout
                        android:id="@+id/termsLayout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/passwordLayout"
                        android:layout_marginLeft="15dp"
                        android:layout_marginRight="20dp"
                        android:layout_marginTop="15dp"
                        android:gravity="center"
                        android:orientation="horizontal"&gt;


                        &lt;ImageView
                            android:id="@+id/check_box"
                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"
                            android:padding="5dp"
                            android:src="@drawable/checkbox_checked" /&gt;

                        &lt;TextView
                            android:id="@+id/terms_and_cond"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="5dp"
                            android:textColor="@color/black"
                            android:textColorLink="#80000000"
                            android:textSize="13sp" /&gt;
                    &lt;/LinearLayout&gt;

                    &lt;View
                        android:id="@+id/lineView"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:layout_below="@id/termsLayout"
                        android:layout_marginTop="15dp"
                        android:background="@color/grey_background" /&gt;

                    &lt;LinearLayout
                        android:id="@+id/newuser_login_layout"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="@color/dark_grey"
                        android:layout_below="@id/lineView"
                        android:orientation="horizontal"&gt;


                        &lt;TextView
                            android:id="@+id/newUserButton"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@drawable/translucent_round_button"
                            android:gravity="center"
                            android:text="New User ?"
                            android:textColor="@color/grey_text_color"
                            android:textSize="17sp" /&gt;

                        &lt;TextView
                            android:id="@+id/loginbutton"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:background="@drawable/bottom_round_button"
                            android:gravity="center"
                            android:text="Login"
                            android:textColor="@color/white"
                            android:textSize="17sp" /&gt;

                    &lt;/LinearLayout&gt;
                &lt;/RelativeLayout&gt;
            &lt;/android.support.v7.widget.CardView&gt;

            &lt;LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_gravity="center"
                android:gravity="center"
                android:orientation="vertical"&gt;


                &lt;TextView
                    android:id="@+id/contactus_button"
                    android:layout_width="wrap_content"
                    android:layout_height="35dp"
                    android:layout_centerHorizontal="true"
                    android:layout_marginBottom="15dp"
                    android:background="@drawable/contact_us_selector"
                    android:drawableLeft="@drawable/contact_us_green"
                    android:drawablePadding="5dp"
                    android:gravity="center"
                    android:padding="8dp"
                    android:text="Contact Us"
                    android:textColor="@color/black" /&gt;

                &lt;TextView
                    android:id="@+id/textviewone"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_centerHorizontal="true"
                    android:layout_marginBottom="10dp"
                    android:layout_marginLeft="15dp"
                    android:layout_marginRight="15dp"
                    android:gravity="center"
                    android:textColor="@color/black"
                    android:textColorLink="#80000000"
                    android:textSize="13sp" /&gt;

            &lt;/LinearLayout&gt;
        &lt;/RelativeLayout&gt;
    &lt;/ScrollView&gt;

    &lt;android.support.design.widget.CoordinatorLayout
        android:id="@+id/snackbarCoordinatorLayout"
        android:layout_width="match_parent"

        android:layout_height="match_parent"
        &gt;

    &lt;/android.support.design.widget.CoordinatorLayout&gt;

    &lt;ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/android:progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:visibility="gone" /&gt;
&lt;/FrameLayout&gt;
</code></pre>

<h1>Question :-</h1>

<p>When keyboard opens then contact us <code>button</code> and text which is at the bottom of above screen hide behind the center layout. I want it should not be hide, on opening keyboard screen should be scroll and contact us <code>button</code> should be at the bottom.</p>

<p>On opening keyboard it looks like :-</p>

<p><a href="https://i.stack.imgur.com/q1QVJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q1QVJ.png" alt="enter image description here"></a></p>
