I have several text edits in a table layout. With small values, the TextEdits stretch to the edge of the screen. However, large values cause the TextEdits to expand past the screen edge. How do I keep the textedit width to the screen edge at all times?
<TableLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:stretchColumns="1">
<TableRow android:baselineAligned="true" android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_width="wrap_content">
<TextView android:id="@+id/textView4" android:layout_height="wrap_content" android:text="Perm:" style="@style/PlainText" android:layout_width="wrap_content"></TextView>
<EditText android:id="@+id/f" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
<TableRow android:layout_height="wrap_content" android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:layout_marginLeft="5dip" android:layout_height="wrap_content" style="@style/PlainText" android:id="@+id/textView5" android:text="w/ repetition:" android:gravity="right"></TextView>
<EditText android:id="@+id/e" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
<TableRow android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_width="wrap_content">
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Combinations:" style="@style/PlainText"></TextView>
<EditText android:id="@+id/d" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
<TableRow android:layout_height="wrap_content" android:layout_width="wrap_content">
<TextView android:layout_width="wrap_content" android:layout_marginLeft="5dip" android:layout_height="wrap_content" style="@style/PlainText" android:id="@+id/textView6" android:text="w/ repetition:" android:gravity="right"></TextView>
<EditText android:id="@+id/c" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
<TableRow android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_width="wrap_content">
<TextView android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="# of subsets:" style="@style/PlainText"></TextView>
<EditText android:id="@+id/b" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
<TableRow android:layout_height="wrap_content" android:gravity="center_vertical" android:layout_width="wrap_content">
<TextView android:id="@+id/TextView04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Pigeonhole:" style="@style/PlainText"></TextView>
<EditText android:id="@+id/z" android:hint="0" android:scrollHorizontally="true"></EditText>
</TableRow>
</TableLayout>
something like this can restrict the no of letters user input into the edit text.
this will restrict the over flow of characters.
i noticed some are numeric fields. so using
or any other matching option.
UPDATE
something like this will stretch the selected column to take up the remaining space
check this link for more info
http://developer.android.com/resources/tutorials/views/hello-tablelayout.html