ok, this is really strange.
I've got a TableLayout with 6 tableRow (defien in xml). I then add (in
Java) a button to the first row and another to the second row. I
expect the 2 row to be on top of each other, but they are actually
next to each other (like columns) ...
my Layout :
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/TableLayout01" xmlns:android="http://
schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:gravity="left|
center_vertical" android:layout_width="wrap_content"
android:background="#00ffff">
<TableRow android:id="@+id/TableRow01"
android:layout_height="wrap_content" android:background="#ff00ff"
android:layout_width="wrap_content"></TableRow>
<TableRow android:layout_height="wrap_content" android:id="@+id/
TableRow02" android:layout_width="wrap_content"></TableRow>
<TableRow android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/TableRow03"></
TableRow>
<TableRow android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/TableRow04"></
TableRow>
<TableRow android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/TableRow05"></
TableRow>
<TableRow android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/TableRow06"></
TableRow>
</TableLayout>
The java code :
TableRow p1 = (TableRow) this.findViewById(R.id.TableRow01);
TableRow p2 = (TableRow) this.findViewById(R.id.TableRow02);
p1.addView(new Button(this));
p2.addView(new Button(this));
I have probably done something stupid and I'm sure there is a simple
fix :)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en