listview with virtual keypad shown in android
I have edittext view and listview in activity. If the user clicks the edittext virtual keypad arrived at the time my screen layout is going up. If virtual keypad hide at the time my screen is going down. How do I avoid this? I want layout to be in the same position and show virtual keypad to user the above layout. I used listview in layout so only layout is moving up. Can anybody tell me how to avoid the layout moving up using list view? This is my layout file:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:background="@color/white" android:id="@+id/mainrelativelayout" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white">
<TableRow>
<EditText android:layout_column="0" android:focusable="true" android:focusableInTouchMode="true" android:id="@+id/edtsearch" android:singleLine="true" android:hint="Enter company name or ticker" android:layout_width="300dip" android:layout_height="40dip" android:textSize="13dip" android:textColor="@color/gray1"></EditText>
<ImageView android:layout_column="1" android:src="@drawable/clearbutton" android:paddingTop="5dip" android:id="@+id/imgsearch" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
</TableRow>
<TableRow>
<ListView android:layout_column="0" android:layout_span="2" android:id="@+id/lstcontent" android:layout_width="wrap_content" android:layout_height="wrap_content"></ListView>
</TableRow>
</TableLayout>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width=开发者_如何学C"fill_parent"
android:layout_height="30dip"
android:id="@+id/imglinear"
android:background="@color/white"
android:layout_alignParentBottom="true"
android:paddingTop="5dip"
android:orientation="horizontal"
>
<TableRow>
<ImageView android:id="@+id/ImageView15" android:paddingRight="20dip" android:layout_gravity="left" android:src="@drawable/questbutton" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
</TableRow>
</TableLayout>
</RelativeLayout>
any help would be appreciated
I even gave in androidmanifest.xml:
android:windowSoftInputMode="adjustPan|adjustResize"
that is not working.
Thanks
Chack these two link ,
http://developer.android.com/resources/articles/on-screen-inputs.html
http://groups.google.com/group/android-developers/browse_thread/thread/be5ffe40c2bc29f0/0bbb31099d64fb04?pli=1
hope it will help you dude.
精彩评论