Hello!

New to Android programming, I want to create the following layout:
1. Background e.g. cyan;
2. Two buttons, each of it be half of screen width wide,
   quarter of screen height high, with some example text;
3. The buttons should be centered, with a filler between them
   with the same height as the buttons.

Some of these requirements I'll have to do in my Activity's code, which currently only loads the view:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

As this isn't too much, I must have done sth. wrong in my layout code:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
    android:orientation="vertical"
    android:background="#18EDF5"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TableLayout>
        <TableRow android:id="@+id/main$p$top">
            <Button android:id="@+id/main$p$button1"
                android:background="@drawable/gradient_box"
                android:text="T E S T 1"
                android:textSize="32dip"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginTop="10dp"
                android:layout_marginRight="40dp"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="40dp"
            />
        </TableRow>
        <View android:id="@+id/main$p$filler"
            android:layout_height="2dip"
            android:background="#FF909090"
        />
        <TableRow>
            <Button android:id="@+id/main$p$button2"
                android:background="@drawable/gradient_box"
                android:text="T E S T 2"
                android:textSize="32dip"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginTop="10dp"
                android:layout_marginRight="40dp"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="40dp"
            />
        </TableRow>
    </TableLayout>
</LinearLayout>

It'd be great, if somebody could tell me, what I've forgotten here - guessing it's about some wrong/illegal/missing id, because the shutdown
might be caused by a NPE (however, just an assumption).

Kind regards

Peter

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to