Layout Problem In Android
I am fairly new to android and am having some problems with a layout. Below is an approximation of what I want the layout to look like. (I would like the list to be below the scree
Solution 1:
From the look of your XML it looks like you misunderstand what fill_parent means. It means "be as big as my parent." Also, why are you using two nested TableLayouts? To divide the screen evenly in two you should use a horizontal LinearLayout and give each child (the TableLayout and your custom View) a width of 0dip and a layout_weight of 1:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_height="wrap_content">
...
</TableLayout>
<android.physicsengine.AxisDrawing
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Solution 2:
That is because you have entered android:layout_span="2" in your EditTexts. If you remove these all behaves more normally.
Then you can control left side by setting the width of EditText to 200dp for example... You can also use right margin of EditText to control the left column.
As for the coordinates in the custom view canvas they start from 0,0 in the top-right corner of it.
Post a Comment for "Layout Problem In Android"