Das Problem mit der Tastatur... android:windowSoftInputMode="adjustPan"

IceEagle

Mitglied
Hallo,

ich habe ein Formular das hat oben ein großes TextView, welches sich zum Scrollen in einem ScrollLayout befindet.
Unter dem scrollLayout ist ein EditText, wo man was rein Schreiben kann.
Wenn man die Tastatur öffnet durch FOCUS im EditText, dann überlappt die Tastatur das Textfeld...
Beheben lässt sich das Problem ja bekanntlich durch folgende Zeile im Manifest:
android:windowSoftInputMode="adjustPan"

Aber diese Variante schiebt mir außerdem auch das Textfeld hoch.
Kann ich einzelne Objekte, wie z.B. das Textfeld davon unberührt lassen, so dass er nur das Eingabefeld hochschiebt, Z-Index über dem Textfeld, so dass ich dann den Text noch oben sehen ....

Es soll sich eigentlich genau so verhalten wie Whatsapp im Chatfenster... Aber ich beiß mir irgendwie die Zähne aus an dem Design...
 
Das ist der XML-Code:


HTML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:background="#444444">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:id="@+id/linearLayout">

        <ScrollView
            android:id="@+id/SCROLLER_ID"
            android:layout_width="fill_parent"
            android:layout_height="431dp"
            android:fillViewport="true"
            android:scrollbars="vertical">

            <TextView
                android:id="@+id/tvChatText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_above="@+id/chatTextField"
                android:layout_centerHorizontal="true"
                android:background="#444444"
                android:text=""
                android:textColor="#FFF"
                android:textSize="16sp" />


        </ScrollView>

    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/linearLayout"
        android:layout_alignParentStart="true">
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <EditText
                    android:id="@+id/chatTextField"
                    android:layout_width="264dp"
                    android:layout_height="40dp"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentStart="true"
                    android:layout_marginTop="8dp"
                    android:background="#ffffff"
                    android:cursorVisible="true"
                    android:ems="10"
                    android:inputType="textPersonName"
                    android:paddingBottom="5dp"
                    android:paddingLeft="5dp"
                    android:paddingRight="5dp"
                    android:paddingTop="5dp"
                    android:text=""
                    android:textCursorDrawable="@null">

                    <requestFocus />
                </EditText>

                <ImageButton
                    android:id="@+id/sendChatText"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="5dp"
                    android:background="#0000"
                    android:onClick="sendChatText"
                    android:scaleType="fitCenter"
                    android:text="send"
                    android:visibility="visible"
                    app:srcCompat="@drawable/papfly" />
            </TableRow>

        </TableLayout>
    </FrameLayout>


</RelativeLayout>
 

Zurück
Oben