Here is the parent xml layout:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp"
Here is the row at the bottom with two buttons:
<TableRow>
<Button
android:id="@+id/clrButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="clrPage"
android:text="@string/clr" />
<Button
android:id="@+id/nextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="nextPage"
android:text="@string/next" />
</TableRow>
I'm having multiple issues with this. 1. The row spans the entire width, which is what I need. However, unless I actually set a weight for the buttons, they both align with white space to the right of them and they don't fill the row. 2. I want the row to be bigger and the buttons to be centered vertically within the row, but changing the height of the row does nothing. The only attribute that allows this change is padding top. 3. Wrap content just doesn't wrap content. The buttons stay the same size no matter what I do. I've tried changing the margins on the buttons and the padding, but I can't get it exact like wrap content can. Any help is appreciated.
No comments:
Post a Comment