Wie legen Sie die Inhalte in Linearer Anordnung an der UNTERSEITE des Bildschirms in Android.?

Finden Sie in der folgenden XML-code

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

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <include layout="@layout/header" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="18dp" />

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/header"
            android:orientation="horizontal" >

            <ImageView
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:src="@drawable/calendar" />

            <TextView
                android:id="@+id/tvTitle"
                android:layout_width="fill_parent"
                android:layout_height="50dp"
                android:gravity="center"
                android:text="@string/calendar"
                android:textColor="#FFFFFFFF"
                android:textSize="18sp" />
        </LinearLayout>

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


        </LinearLayout>
        <!-- <include layout="@layout/footer"/> -->

        <LinearLayout 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@drawable/datename_bottom_bg"
            android:orientation="horizontal">


            <TextView
                android:id="@+id/upgrade_4"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_weight="1"
                android:drawableTop="@drawable/upgrade"
                android:gravity="center"
                android:text="@string/upgrade"
                android:textSize="8sp" />

            <TextView
                android:id="@+id/panchang_4"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_weight="1"
                android:drawableTop="@drawable/kalash_bottom"
                android:gravity="center"
                android:text="@string/panchang"
                android:textSize="8sp" />

            <TextView
                android:id="@+id/time_range_4"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_weight="1"
                android:drawableTop="@drawable/timer_bottom"
                android:gravity="center"
                android:text="@string/timespan"
                android:textSize="8sp" />

            <TextView
                android:id="@+id/reminder_4"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_weight="1"
                android:drawableTop="@drawable/reminder_bottom"
                android:gravity="center"
                android:text="@string/reminders"
                android:textSize="8sp" />
            <!--
         <TextView android:id="@+id/calendar_4" android:layout_width="50dp" android:layout_height="50dp" android:drawableTop="@drawable/calendar_bottom"
         android:text="@string/calendar" android:textSize="8sp" android:gravity="center" android:layout_weight="1"/>
            -->
        </LinearLayout >
    </LinearLayout>

</ScrollView>

Wie das aussieht, ist auf der linken Seite und ich möchte, dass es aussieht wie auf der rechten, ich habe auch versucht, es durch das ersetzen LinearLayout zu RelativeLaout aber immer noch nicht funktioniert. Bitte Um Hilfe.!
Wie legen Sie die Inhalte in Linearer Anordnung an der UNTERSEITE des Bildschirms in Android.?

  • Verwenden Sie eine LinerLayout als root-element und nest der ScrollView (plus eine zusätzliche LinearLayout) in es. Dann verschachteln Sie Ihre Fußzeile außerhalb des ScrollView. Das sollte es tun.
  • Sie können eine relative layout und platzieren Sie es an der Unterseite
  • Wenn der ScrollView ist größer als der Bildschirm sind, wollen Sie das LinearLayout werden am unteren Rand des Bildschirms (wie im rechten Bild) oder am Ende der ScrollView?
  • Ich kann nicht sehen, dein Bild. was wollen Sie, es sieht aus wie auf der rechten Seite
  • Ich will es wie meine Rechte Bild.
  • Dann versuchen @Vyacheslav Antwort, ich denke, das ist, was Sie wollen.
  • Ich habe den gleichen Fall , ich will das linear-layout auf der Unterseite der scrollview wenn der scrollview geht die größer als der Bildschirm, aber ich will es am unteren Rand des Bildschirms, wenn der scrollview kürzer ist als der Bildschirm, bitte um Hilfe.

InformationsquelleAutor Dnyanesh M | 2013-07-19
Schreibe einen Kommentar