Java – part of my layout moves up with the keyboard
•
Java
My Android application has such a layout. When I open the keyboard, two imageviews are displayed on the keyboard at the bottom of the page. I can't see the problem. Why is it up with the keyboard? Can you help me with this?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:id="@+id/searchLinear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/upperbackground">
<EditText
android:id="@+id/search@R_173_2419@"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_margin="12dip"
android:paddingLeft="35dip"
android:textSize="15sp"
android:background="@drawable/search_bar"/>
</LinearLayout>
<LinearLayout
android:id="@+id/searchButtons"
android:layout_below="@id/searchLinear"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:background="@color/upperbackground">
<ImageView
android:id="@+id/btnSukela"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:onClick="sukelaClickEvent"
android:paddingRight="8dip"
android:paddingBottom="5dip"
android:src="@drawable/sukela"/>
<ImageView
android:id="@+id/btnSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/btnSukela"
android:clickable="true"
android:focusable="true"
android:onClick="searchEntryClickEvent"
android:paddingLeft="8dip"
android:paddingBottom="5dip"
android:src="@drawable/search"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/bottomLinear"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:background="@drawable/bottom_back">
<ImageView
android:id="@+id/btnToday"
android:src="@drawable/today"
android:background="@color/bottombackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/bottomLinear"
android:layout_marginBottom="19dip"
android:layout_centerVertical="true"
android:clickable="true"
android:focusable="true"
android:onClick="todayClickEvent"/>
<ImageView
android:id="@+id/btnPopular"
android:src="@drawable/popular"
android:background="@color/bottombackground"
android:layout_toRightOf="@+id/btnToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:clickable="true"
android:focusable="true"
android:onClick="popularClickEvent"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/searchButtons"
android:layout_above="@+id/bottomLinear"
android:background="@color/background">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
</RelativeLayout>
Solution
I think you need to set soft input mode:
<activity android:windowSoftInputMode="adjustPan" ...>
In your list, the window will not resize when the keyboard appears
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码
