Android-Scrollview in RelativeLayout mit Knopfleiste

Ich versuche, die Implementierung eines login-Ansicht, wo mehrere EditTexts und ein logo auf dem Bildschirm angezeigt werden, mit einer Knopfleiste an der Unterseite, so etwas wie dieses:

alt-text http://russellhaering.com/media/addAccount.png

Das problem ist, dass auf sehr kleinen Bildschirmen, vor allem, wenn er seitlich gedreht, der gesamte main-Ansicht nicht auf den Bildschirm passen.

Momentan habe ich

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#234C59"  >
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingTop="5dip"
        android:paddingLeft="15dip"
        android:paddingRight="15dip"
        android:orientation="vertical" >
        <ImageView
            android:id="@+id/logo"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitCenter"
            android:layout_centerHorizontal="true"
            android:src="@drawable/logo" />
        <EditText
            android:id="@+id/input_email"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:inputType="textEmailAddress"
            android:singleLine="true"
            android:hint="Username or email" />
        <EditText
            android:id="@+id/input_password"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop=""
            android:inputType="textPassword"
            android:singleLine="true"
            android:hint="Password" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/buttonbar_login"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        style="@android:style/ButtonBar" >
        <Button
            android:id="@+id/button_signup"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Sign Up" />
        <Button
            android:id="@+id/button_login"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Log In" />
    </LinearLayout>
</RelativeLayout>

Habe ich versucht, die Kapselung der ersten LinnearLayout in eine ScrollView, die wie folgt aussieht:

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
            <!-- Linear Layout Here -->
</ScrollView>

Aber das bringt zwei Probleme:

  1. Den ScrollView nicht scrollen, auch auf Bildschirme, in denen die Daten nicht alle fit

  2. Der ButtonBar schwimmt oben auf der onscreen-Tastatur verdeckt noch mehr von dem Bildschirm, wenn Sie die Tastatur hoch kommt.

Alles Super geklappt, wenn ich die Knöpfe innerhalb der ScrollView, aber jetzt, dass ich Sie in der Buttonleiste ich habe eine Menge von Schwierigkeiten herauszufinden dieses heraus.

InformationsquelleAutor russell_h | 2010-08-03
Schreibe einen Kommentar