dimanche 10 mai 2015

Keyboard shifts buttons when it appears android

I have a layout in which I have a layout that contains 4 buttons at the bottom.The problem is that when keyboard appears the buttons get pushed to top along with the keyboard.I tried adding windowSoftInputMode:"adjustpan|adjustNothing" to it,but it ain't working.Also tried setting my parent layout to setScrollableState="false".But this isn't working as well.I want the keyboard to overlap that button layout.

This is my layout..
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    xmlns:app="http://ift.tt/GEGVYd"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:isScrollContainer="false" >


    <FrameLayout
        android:id="@+id/buttons_layout"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_alignParentBottom="true"
        android:background="@color/background_blue">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:orientation="horizontal"
            android:weightSum="4">

            <CustomButton
                android:id="@+id/btn1"
                android:layout_width="wrap_content"
                android:layout_height="60dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:text="Button1"
                android:textAllCaps="false"
                android:paddingBottom="10dp"
                android:paddingTop="5dp"
                android:gravity="center|bottom"
                android:textColor="@color/white"
                android:textSize="12sp"
                app:font="@string/gotham_light" />

            <CustomButton
                android:id="@+id/btn2"
                android:layout_width="wrap_content"
                android:layout_height="60dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:text="Button2"
                android:paddingBottom="10dp"
                android:textAllCaps="false"
                android:paddingTop="5dp"
                android:gravity="center|bottom"
                android:textColor="@color/transparent_white"
                android:textSize="12sp"
                app:font="@string/gotham_light" />

            <CustomButton
                android:id="@+id/btn3"
                android:layout_width="wrap_content"
                android:layout_height="60dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:text="Button3"
                android:paddingTop="5dp"
                android:paddingBottom="10dp"
                android:textAllCaps="false"
                android:gravity="center|bottom"
                android:textColor="@color/transparent_white"
                android:textSize="12sp"
                app:font="@string/gotham_light" />

            <CustomButton
                android:id="@+id/btn4"
                android:layout_width="wrap_content"
                android:layout_height="60dp"
                android:layout_gravity="center"
                android:layout_weight="1"
                android:background="@android:color/transparent"
                android:text="Button4"
                android:textAllCaps="false"
                android:paddingTop="5dp"
                android:paddingBottom="10dp"
                android:gravity="center|bottom"
                android:textColor="@color/transparent_white"
                android:textSize="12sp"
                app:font="@string/gotham_light" />
        </LinearLayout>

    </FrameLayout>



    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_above="@id/buttons_layout"></FrameLayout>

</RelativeLayout>

I have 4 fragments that are replaced on those button presses.Any help appreciated.Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire