I created an android screen with LinearLayoutin which I used the layout_sum property to split the screen. In this created EditTextfor search in ListView, it seems, before opening the soft keyboard. But when I open the soft keyboard EditText, you can hide as shown in the images.
Here is my xml code.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="3"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="4" >
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1"
android:gravity="center"
android:text="T100"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1"
android:gravity="center"
android:text="A100"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1"
android:gravity="center"
android:text="P100"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1"
android:gravity="center"
android:text="S100"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="4" >
<TextView
android:id="@+id/txtSearch"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_below="@id/lvdetail"
android:text="Search :"
android:layout_weight="1"
android:gravity="center"/>
<EditText
android:id="@+id/eatmcode"
android:layout_width="0dp"
android:layout_height="match_parent"
android:ems="2"
android:focusableInTouchMode="true"
android:hint="Enter ATM"
android:imeOptions="actionSearch"
android:inputType="text"
android:textSize="16dp"
android:layout_weight="2"/>
</LinearLayout>
<TextView
android:id="@+id/txtLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/txtSearch"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal"
android:paddingTop="10dp"
android:text="List of Vehicle"
android:textSize="14dp"
android:textStyle="bold" />
</LinearLayout>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.1"
android:transcriptMode="normal" >
</ListView>
</LinearLayout>
Screen before opening the keyboard

after opening the keyboard

Any help would be assigned. Thanks.
source
share