/ / android linearlayout Druckknopf - Android

Android Linearlayout-Druckknopf - Android

Hallo ich habe 2 Artikel in einem linearen Layout und ich muss sie auf dem Bildschirm unten schieben. Jetzt fangen sie bei Bildschirm an. Wie kann ich es tun?

<?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">


<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_gravity="bottom"
android:gravity="bottom"
android:src="@drawable/splash" />

<include
android:layout_gravity="bottom"
android:id="@+id/footer_raw"
android:layout_width="fill_parent"
android:gravity="bottom"
android:layout_height="30dp"
layout="@layout/footer_raw" />
</LinearLayout>

Antworten:

2 für die Antwort № 1

Ersetzen LinearLayout mit RelativeLayout und gebe android:layout_alignParentBottom= "wahr" zu deinem footer_raw


0 für die Antwort № 2

Hinzufügen android:layout_gravity="bottom" zu Ihrem übergeordneten Layout.


0 für die Antwort № 3

ändere den Code darauf

<?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:layout_gravity="bottom"
android:orientation="vertical">


<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_gravity="bottom"
android:gravity="bottom"
android:src="@drawable/splash" />

<include
android:layout_gravity="bottom"
android:id="@+id/footer_raw"
android:layout_width="fill_parent"
android:gravity="bottom"
android:layout_height="30dp"
layout="@layout/footer_raw" />
</LinearLayout>

0 für die Antwort № 4

Wende dieses Attribut auf deine Gegenstände an,
android: layout_gravity = "unten". oder verwenden Sie das relative Layout als übergeordnetes Layout.