Android EditText Layout like Gmail Compose Screen

I am trying to implement the following:

Please check the image here:

enter image description here

The problem is that the user absorbs the email text field, the send / save / discard buttons are hidden using the on-screen keyboard.

Any ideas on how to make these buttons always visible? Thank.

[EDIT] In the end, it was decided! You will have to use Lingleayout instead of RelativeLayout and assign the correct layout_weight parameter. Many thanks to Femi for pointing out that buttons should be outside of ScrollView.

Here is the final working xml layout if anyone finds it useful:

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"><ScrollView android:layout_alignParentTop="true" 
    android:layout_weight="1"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <RelativeLayout 
        android:id="@+id/InnerRelativeLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" >
        <EditText 
            android:id="@+id/editTextCompose" 
            android:layout_width="fill_parent"
            android:layout_height="200dp"
            android:gravity="top"
            android:singleLine="false" android:lines="5"
            android:inputType="text"
            android:layout_below="@+id/editTextSubject"
            >
        </EditText>
    </RelativeLayout>
</ScrollView><TableLayout android:id="@+id/recipeButtons" 
    android:background="#B0B0B0" android:padding="3dip" 
    android:stretchColumns="0,1" android:layout_alignParentBottom="true" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> 
    <TableRow android:gravity="center"> 
        <Button android:id="@+id/editOtherAdditionButton" 
            android:text="Save" /> 
        <Button android:id="@+id/removeOtherAdditionButton" 
            android:text="Delete" /> 
    </TableRow> 
</TableLayout></LinearLayout>
+3
source share
2 answers

All Articles