lundi 18 mai 2015

RelativeLayout gravity bottom?

I'm trying use gravity to bottom with a RelativeLayout. When I use android:gravity="bottom" does not align on bottom.

How could I do this ?

<LinearLayout
    xmlns:android="http://ift.tt/nIICcg"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/fundo"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_margin="10dp">
        <ImageView
            android:layout_margin="10dp"
            android:padding="10dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/logo"/>
    </LinearLayout>


    <!-- Control -->
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="80dp"
        android:orientation="vertical"
        android:gravity="bottom">

        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="50dp"
            android:background="@drawable/bar_bot_player"/>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="50dp"
            android:layout_marginTop="-20dp"
            android:orientation="horizontal"
            android:gravity="center"
            android:weightSum="1">
            <ImageButton
                android:id="@+id/btPlay"
                android:layout_width="50dp"
                android:background="@drawable/btnplay"
                android:gravity="center"
                android:layout_height="wrap_content" />

            <ImageButton
                android:id="@+id/btStop"
                android:visibility="gone"
                android:layout_width="50dp"
                android:background="@drawable/stop"
                android:gravity="center"
                android:layout_height="wrap_content" />
        </LinearLayout>

    </RelativeLayout>


</LinearLayout>

Aucun commentaire:

Enregistrer un commentaire