1

I have one activity.it has one vertical linearlayout. When the soft keyboard opens, it pushes linearlayout with resize or pan. But I want to chop the top part of linearlayout and push it. 'adjustResize' and 'adjustPan' are different from what I said. How can do I?

1 Answers1

2

Define this property android:windowSoftInputMode="adjustResize" in Activity Tag within manifest file. Put LinearLayout inside the ScrollView for example

 <ScrollView
        android:id="@+id/scrollParent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/includeHeader"
        android:scrollbars="none" >

        <RelativeLayout
            android:id="@+id/relCardManagement"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:background="@color/white_font"
            android:gravity="center_horizontal"
            android:padding="10dp" >

            <!-- 1st start -->

            <RelativeLayout
                android:id="@+id/relChangePin"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/drawable_editplan"
                android:padding="5dp" >

                <ImageView
                    android:id="@+id/imageLogoChangePin"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content" />

                <TextView
                    android:id="@+id/tvChangePin"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@+id/imageLogoChangePin"
                    android:text="@string/chnge_pin"
                    android:textColor="@color/black_font" />

                <ImageView
                    android:id="@+id/imageArrowChangePin"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:background="@drawable/ic_arrow_image" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/relChangePinListener"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/relChangePin"
                android:visibility="gone" >

                <include
                  android:id="@+id/includeChangePin"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    layout="@layout/change_pin_activity" />
            </RelativeLayout>
        </RelativeLayout>
    </ScrollView>

I hope this will help you.

Lavekush Agrawal
  • 6,040
  • 7
  • 52
  • 85