How to do this layout? (Link on Image)

Posted by Spredzy on Stack Overflow See other posts from Stack Overflow or by Spredzy
Published on 2010-04-12T06:32:38Z Indexed on 2010/04/12 6:53 UTC
Read the original article Hit count: 400

Filed under:
|

Hi all,

I was wondering how to obtain this result :

http://img718.imageshack.us/img718/6173/screenshot20100411at126.png

This is what I tried :

<RelativeLayout android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:background="#CCCCCC"
                  android:orientation="horizontal"
                  android:layout_weight="0">

        <Button android:id="@+id/btn_cancel"
                android:text="@string/cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5px"
                android:gravity="left"
                />

        <Button android:id="@+id/btn_save"
                android:text="@string/save"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5px"
                android:layout_toRightOf="@id/btn_cancel"
                android:gravity="right"/>
    </RelativeLayout>

I tried to play with the layout_width properties and setting them up to fill parents both of them but did not work, if anyone has an idea ... Thank you !

© Stack Overflow or respective owner

Related posts about android

Related posts about android-layout