android questions about poping the soft keyboard

68 Views Asked by At

i want the whole layout move up to show while popping the soft keyboard, but the button on the bottom of the view cannot be seen.

the AndroidManifest.xml:

    <activity
    android:name="cn.duckr.android.plan.PlanConfirmPaymentActivity"
    android:windowSoftInputMode="adjustPan"
    style="@style/base_activity_style"
    android:theme="@style/confirm_payment_anim_theme" />
2

There are 2 best solutions below

0
Emil On

To ensure that the system resizes your layout to the available space—which ensures that all of your layout content is accessible (even though it probably requires scrolling)—use "adjustResize".

link

 android:windowSoftInputMode="adjustResize"
0
Nizamuddin Mohamed On

You can put whole layout except the particular button in a ScrollView to achieve this.

like this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
     <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scrollView5"
        android:fillViewport="true">

            //put your contents here..      
     </ScrollView>

     <ImageButton
           android:id="@+id/ibSample"
           android:layout_width="50dp"
           android:layout_height="50dp"
           android:adjustViewBounds="true"/>

</RelativeLayout>