Android Soft Keyboard Overlay Buttons (screenshot)

I use the Sherlock tabs and therefore have fragment activity for the tab. Unfortunately, when the keyboard appears, the following happens:

enter image description here

The keyboard overlaps the two buttons directly below the third text box. However, I want the two buttons to display when the keyboard is open.

I tried a couple of things:

  • Added android:windowSoftInputMode="adjustResize" , as well as android:windowSoftInputMode="adjustPan" in the action that contains these three tabs
  • An illustrated fragment of a scroll tab is wrapped, which partially works, allowing you to scroll the screen to view two buttons

This is the XML for the snippet:

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#EBEBEB" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="20dp" android:layout_weight="1" android:gravity="right" > <EditText android:id="@+id/TextBox" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#ffffff" android:height="50dp" android:hint="@string/BoxHint" android:paddingLeft="15dp" > </EditText> <TextView android:id="@+id/LocBoxHint" android:layout_width="50dp" android:layout_height="50dp" android:layout_below="@+id/TextBox" android:background="#ffffff" android:gravity="center" android:padding="10dp" android:text="\@" android:textSize="22dp" /> <EditText android:id="@+id/LocBox" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/TextBox" android:layout_toRightOf="@+id/LocBoxHint" android:background="#ffffff" android:hint="Joey&apos;s Pizza" > </EditText> <TextView android:id="@+id/DateTimeBoxHint" android:layout_width="50dp" android:layout_height="50dp" android:layout_below="@+id/LocBoxHint" android:background="#ffffff" android:gravity="center" android:padding="10dp" android:text="#" android:textSize="22dp" /> <EditText android:id="@+id/DateTimeBox" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/LocBox" android:layout_toRightOf="@+id/DateTimeBoxHint" android:background="#ffffff" android:hint="Friday 8pm" android:paddingRight="60dp" android:layout_marginBottom="50dp" /> <ImageButton android:id="@+id/DateTimePicker" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignParentRight="true" android:layout_below="@+id/LocBox" android:onClick="dateTimeButton" android:src="@drawable/ic_menu_today" android:background="#ffffff" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="50dp" android:layout_below="@+id/DateTimeBox" android:orientation="horizontal" android:layout_marginTop="-50dp" > <Button android:id="@+id/infoButton" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_weight="5" android:onClick="infoButton" android:text="i" android:textColor="#ffffff" /> <Button android:id="@+id/Button" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_weight="2" android:onClick="planButton" android:text="@string/Button" android:textColor="#ffffff" /> </LinearLayout> </RelativeLayout> </LinearLayout> 

Any thoughts?

+4
source share
1 answer

your parent layout changes it linearly in the relative layout, as in the following code

 <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/theme_black_bg" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/bottom_bar" android:layout_below="@+id/top_bar" android:layout_marginTop="15dip" android:gravity="center_horizontal" android:orientation="vertical" > <LinearLayout android:id="@+id/linearlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/email_edit_bg" android:gravity="center_horizontal" android:orientation="vertical" > <EditText android:id="@+id/LoginEmailAddressEditTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/edit_text_bg" android:ems="2" android:hint="Please enter email" android:paddingLeft="5dip" android:paddingRight="5dip" android:focusable="true" android:focusableInTouchMode="true" android:singleLine="true" android:textColor="@color/label_color_white" android:textColorHint="#FFFFFFFF" android:textSize="12sp" /> </LinearLayout> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dip" android:layout_marginTop="10dip" android:background="@drawable/separator_bg" /> <EditText android:id="@+id/LoginPasswordEditTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/edit_text_bg" android:ems="2" android:hint="@string/hint_password" android:inputType="textPassword" android:paddingLeft="5dip" android:paddingRight="5dip" android:singleLine="true" android:textColor="@color/label_color_white" android:textColorHint="#FFFFFFFF" android:textSize="12sp" /> <Button android:id="@+id/LoginScreenLoginButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:background="@drawable/login_btn_selector" /> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dip" android:layout_marginTop="10dip" android:background="@drawable/separator_bg" /> <Button android:id="@+id/LoginScreenForgotPasswordButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:background="@drawable/forgot_password_btn_selector" /> </LinearLayout> <include android:id="@+id/bottom_bar" android:layout_alignParentBottom="true" layout="@layout/bottom_advertisement_merge_layout" /> </RelativeLayout> 
+1
source

All Articles