Ich habe versucht, überall zu suchen, aber ich kann nicht scheinen, das herauszufinden. Grundsätzlich habe ich ein Layout mit Scrollview und Elementen darin. Ich möchte eine Schaltfläche in der Bildlaufleiste einfügen, die sich am Ende/unten befindet und Sie können sie nur sehen, wenn Sie den Bildlauf ganz nach unten durchführen. Ich habe versucht, es so zu tun:Wie man den Knopf auf den Boden von Scrollview setzt
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/topcontainer">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar_review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:title="Review Your Massage">
</android.support.v7.widget.Toolbar>
<include layout="@layout/card_review"/>
</LinearLayout>
<Button
android:id="@+id/buttonReview"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:background="@color/colorAccent"
android:text="@string/book"
android:layout_below="@+id/topcontainer"
/>
</RelativeLayout>
</ScrollView>
Der Knopf ist in der Tat am Ende, aber es gibt Raum darunter. Wenn ich die App auf einem Telefon mit größerer Auflösung verwende, befindet sich die Schaltfläche fast in der Mitte des Bildschirms. Wie kann ich es so machen, egal in welcher Auflösung es immer unten bleiben wird?
Hier ist ein Screenshot von dem, was es sieht aus wie im Moment:
android entfernen: layout_alignParentBottom = "true" – Pavya
Set Höhe von Scroll = "match_parent" & nicht "wrap_content" gleiche gilt für RelativeLayout –
und Add unter . Relatives Layout entfernen –
Pavya