0

Can somebody plz post the xml layout code for this (have a look at the link), really don't get this done... Thanks.

http://img832.imageshack.us/img832/6589/layouthelp.jpg

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/background" android:layout_gravity="bottom" android:orientation="vertical" android:baselineAligned="false">
<ImageView android:id="@+id/ImageView01" android:layout_width="fill_parent" android:background="@drawable/logo" android:layout_height="wrap_content"></ImageView>
<LinearLayout android:layout_gravity="center_vertical" android:id="@+id/LinearLayout02" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button02" android:layout_gravity="right" android:text="@+id/Button02"></Button>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button03" android:text="@+id/Button03"></Button>
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button01" android:layout_gravity="bottom" android:text="@+id/Button01"></Button>
</LinearLayout>
</LinearLayout>
3
  • Post what you have tired and then we can help you correct it!(Right now your just asking us to do your work (homework?) for you... Commented Jan 12, 2011 at 11:51
  • Well this is my xml file right now. The Buttons wont come down, but layout_gravity is set to bottom.... Commented Jan 12, 2011 at 11:55
  • 3
    Have you considered trying DroidDraw.org? It is a great help for us XML noobs to get started. Commented Jan 12, 2011 at 13:00

1 Answer 1

7

Try to use RelativeLayout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  android:id="@+id/LinearLayout01"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android"
  >
 <RelativeLayout
     android:id="@+id/LinearLayout02"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:layout_alignParentBottom="true"
     android:layout_alignParentLeft="true"
     >
  <Button
        android:id="@+id/Button02"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+id/Button02"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        >
    </Button>
    <Button
        android:id="@+id/Button03"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+id/Button03"
        android:layout_toLeftOf="@+id/Button02"
        android:layout_alignParentBottom="true"
        >
    </Button>
    <Button
        android:id="@+id/Button01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@+id/Button01"
        android:layout_above="@+id/Button02"
        android:layout_alignParentRight="true"
        >
    </Button>
 </RelativeLayout>
 <ImageView
     android:id="@+id/ImageView01"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_alignParentTop="true"
     android:layout_alignParentLeft="true"
     >
 </ImageView>

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, works! And works also without the second relative layout

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.