Platzieren Sie eine "Feste Höhe" - button am unteren Rand des Bildschirms immer

Möchte ich halten Sie eine Taste an der Unterseite von meinem Bildschirm Aktivität. Es muss fixiert werden, unabhängig von der Größe der scrollview oben. Das problem ist, dass, sobald die textviews der scrollview nehmen etwas Platz, die Höhe von mein-button hält ab, und es gelangt schließlich schob aus dem Bildschirm Aktivität. Dies ist das layout, das ich verwende.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical">

    <TextView android:id="@+id/tvBanner" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" android:gravity="center"
        android:text="Practice Exam" />


    <ScrollView android:id="@+id/Scroll" android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout android:id="@+id/LinearLayout1"
            android:layout_width="match_parent" android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView android:id="@+id/tvDesc" android:layout_width="fill_parent"
                android:layout_height="wrap_content" android:layout_margin="10dp"
                android:gravity="center" android:paddingTop="40dp" android:text="@string/welcom"
                android:textSize="20sp" />

            <TextView android:id="@+id/tvURL" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_marginBottom="30dp"
                android:paddingTop="10dp" android:layout_gravity="center"
                android:text="hello" android:textColor="@android:color/white"
                android:typeface="sans" />
        </LinearLayout>
    </ScrollView>

    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:gravity="bottom">

        <Button android:id="@+id/btBottom" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="1"
            android:text="Enter" />

    </RelativeLayout>



</LinearLayout>

Habe ich auch versucht, mit android:Gewicht=1 und android:layout_height=0dp in der Scrollview. Aber dies entfernt den gesamten Scrollview Teil von meiner Tätigkeit und ich kann nichts sehen.

Ich weiß, dass es viele ähnliche Fragen zu diesem und glauben Sie mir, ich habe versucht, viele dieser. Jedoch, keiner der tricks die gearbeitet haben für mich. Ich habe fast einen halben Tag dies zu beheben. Bitte helfen.

InformationsquelleAutor ambit | 2012-03-07
Schreibe einen Kommentar