Not sure what I am doing wrong, but I am trying to put 5 check boxes in a single table row. The row seems to end after the first check box, and the remaining 4 check boxes are appearing outside the row. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<TextView
android:id="#+id/txtView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:typeface="serif"
android:textSize="18sp"
android:text="#string/start_head"
android:gravity="center"
android:layout_span="5"
android:layout_marginTop="10dp" >
</TextView>
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp" >
<CheckBox
android:id="#+id/chkAtm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/atm" />
<CheckBox
android:id="#+id/chkGift"
android:layout_width="wrap_content"
android:text="#string/giftcard" />
<CheckBox
android:id="#+id/chkRing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/ring" />
<CheckBox
android:id="#+id/chkMerchant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/merchant" />
<CheckBox
android:id="#+id/chkCod"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/cod" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal" >
<Button
android:id="#+id/btnRun"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="#string/run"
android:layout_span="5" />
</TableRow>
</TableLayout>
Your second CheckBox hasn't got android:layout_height, check it ;)
Related
I am trying to do my first complex GUI, but now i can't to solve this problem.
The first column of the first two rows only needs to contain the label, while the second column of the first two rows must occupy the remaining space.
In this snapshot the problem that i noticed is that the first column is larger than i would like.
This is the piece of code that implements that piece of layout.
...
...
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#drawable/linear_layout_background"
android:stretchColumns="*"
android:shrinkColumns="*">
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp" >
<TextView
android:id="#+id/textViewPlateValueLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/plateValue"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/productID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/back"
android:ems="5"
android:text="#string/blank"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp" >
<TextView
android:id="#+id/ztlLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/ztl"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/ztlShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/back"
android:text="#string/blank"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="center" >
<TextView
android:id="#+id/isAllowed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/blank"
android:background="#drawable/back"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
</TableLayout>
...
...
In addition, since they are really impractical, I would like to ask you some advice on the best approaches to use than this.
You can try using layout_weight like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="horizontal"
tools:context=".MainActivity" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#ff00ff"
android:stretchColumns="*"
android:shrinkColumns="*">
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<TextView
android:id="#+id/textViewPlateValueLabel"
android:layout_weight="3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Label1:"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/productID"
android:layout_weight="7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#00ff00"
android:ems="5"
android:text="Some Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp" >
<TextView
android:layout_weight="3"
android:id="#+id/ztlLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Label2:"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_weight="7"
android:id="#+id/ztlShow"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#00ff00"
android:text="Some Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="center" >
<TextView
android:id="#+id/isAllowed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Some Text"
android:background="#0088ff"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
</TableLayout>
</LinearLayout>
I wouldn't use TableLayout, if I were you. I'd probably use LinearLayout or RelativeLayout. You can get the same effect with some of the XML attributes. This is akin to using HTML's table attribute vs. using divs to simulate tables.
So, instead of a table, you can have LinearLayout inside of LinearLayout to simulate a table.
Although canDroid, could be sufficient to some of us, it didn't worked for me, I tried all kind of tricks to make the TableLayout to work. I found LinearLayout much easier to use, here is an example of TableLayout "like" layout using LinearLayout, few cells with a thumbnail, and few without.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="94dp"
android:layout_margin="5dp"
android:text="#string/nut1" />
</LinearLayout>
<View
android:layout_width="395dp"
android:layout_height="2dp"
android:background="#color/colorPrimary"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="0dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">
<ImageView
android:layout_width="94dp"
android:layout_height="94dp"
android:adjustViewBounds="false"
android:background="#drawable/one"
android:contentDescription="#string/nut3"
android:cropToPadding="false"
android:saveEnabled="false"
android:scaleType="center" />
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="94dp"
android:layout_margin="10dp"
android:text="#string/nut3" />
</LinearLayout>
</LinearLayout>
I want this special table layout:
In my current layout the cells that are shorter are at the same size like the cells with the long text:
How do have to do it?
It should look like the first picture.
There may be better ways of doing this, I actually haven't used TableLayout before, but the XML below gives the basic layout that you asked for:
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="4"
android:layout_weight="1"
android:text="Text"
android:gravity="center" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="3"
android:layout_weight="0.75"
android:text="Text that is longer than other cells" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:text="Text" />
</TableRow>
</TableLayout>
Yojimbo, you are right, however if you use
android:layout_weight
you must remember about replacing (in this special case) android:layout_width="wrap_content" with
android:layout_width="0dp" .
Here you have a nice reference.
I'm developing an Android app.
I have this layout:
I don't want to let a textview fill a entire column. As you can see on previous image there is a TextView surrounded with a blue rectangle (in fact is selected). This is the XML code that creates that TableRow:
<TableRow>
<TextView
android:id="#+id/txtFactLoc"
android:layout_span="2"
android:gravity="center_vertical|right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="#string/layout_fac_location"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/factLocVal"
android:layout_span="4"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:layout_height="match_parent"
android:background="#color/textview_background"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/txtConFactLoc"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="#string/layout_confirm"
android:textAppearance="?android:attr/textAppearanceMedium" />
<RadioGroup
android:id="#+id/rGroupFactLoc"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="#+id/rFactLocYes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="#string/layout_yes" />
<RadioButton
android:id="#+id/rFactLocNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/layout_no" />
</RadioGroup>
</TableRow>
Is inside a TableLayout with eight columns. This is the beginning for TableLayout:
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow>
<TextView
android:id="#+id/txtPONo"
android:layout_weight=".125"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="#string/layout_po_no"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/pONoVal"
android:layout_weight=".125"
android:layout_width="0dip"
android:paddingLeft="10dp"
android:layout_height="match_parent"
android:background="#color/textview_background"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/txtIndNo"
android:layout_weight=".125"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="#string/layout_ind_no"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/indNoVal"
android:layout_weight=".125"
android:layout_width="0dip"
android:paddingLeft="10dp"
android:layout_height="match_parent"
android:background="#color/textview_background"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/txtTimeIn"
android:layout_weight=".1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="#string/layout_time_in"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/timeInVal"
android:layout_weight=".15"
android:layout_width="0dip"
android:paddingLeft="10dp"
android:layout_height="match_parent"
android:background="#color/textview_background"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/txtTimeOut"
android:layout_weight=".1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:text="#string/layout_time_out"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/timeOutVal"
android:layout_weight=".15"
android:layout_width="0dip"
android:paddingLeft="10dp"
android:layout_height="match_parent"
android:background="#color/textview_background"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
Some textViews have a background color. As you can see all of them fill its columns and I don't want that because this form looks very ugly.
How can I change TextView width? If I have set android:layout_span="2" I can't change its width.
With android:stretchColumns, you can decide which columns are allowed to be streched (put it in the TableLayout tag).
android:stretchColumns="0"
android:stretchColumns="0,1,2"
android:stretchColumns="*"
When creating a listview layout, is it advisable to keep the layouts as simple as possible with relative layouts and minimal images and text, or is it ok to make them a little fancier with a couple of buttons, possibly an image or two, and some text within tablelayouts?
I am trying to minimise the clicks/touches to get to the pertinent information, and giving the user a nicer UI to play with as opposed to a bog standard list.
I've tried to research it but cant find guidlines on design layout and limitations on listviews.
Something tells me the xml below is the cause of the choking the listview experiences if the resultset grows to more than say 20?
Thank you.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#color/White" android:gravity="center">
<TableLayout android:layout_height="wrap_content" android:id="#+id/tableLayout1" android:layout_width="fill_parent">
<TableRow android:id="#+id/tableRow1" android:layout_height="wrap_content" android:layout_width="fill_parent">
<LinearLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="#+id/linearLayout2">
<ImageView android:layout_marginRight="10px" android:layout_width="60dip" android:layout_marginTop="4px" android:id="#+id/icon" android:layout_height="60dip" android:src="#drawable/indian" android:layout_marginLeft="4px"></ImageView>
<TableLayout android:layout_height="match_parent" android:id="#+id/tableLayout2" android:layout_width="fill_parent">
<TableRow android:id="#+id/tableRow5" android:layout_height="wrap_content" android:layout_width="fill_parent">
<TextView android:focusableInTouchMode="false" android:paddingTop="5dip" android:textColor="#color/Black" android:id="#+id/title" android:textSize="18dip" android:layout_height="wrap_content" android:maxLines="10" android:layout_gravity="left" android:focusable="false" android:layout_width="fill_parent" android:text="#+id/label"></TextView>
</TableRow>
<TableRow android:id="#+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:textColor="#color/Black" android:layout_height="wrap_content" android:id="#+id/distanceText" android:textSize="12dip" android:layout_width="wrap_content" android:gravity="center" android:layout_gravity="left" android:text="TextView"></TextView>
</TableRow>
</TableLayout>
</LinearLayout>
</TableRow>
<TableRow android:id="#+id/tableRow2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:paddingBottom="15dip">
<LinearLayout android:id="#+id/linearLayout3" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TableLayout android:layout_height="match_parent" android:id="#+id/tableLayout3" android:layout_width="fill_parent">
<TableRow android:layout_height="match_parent" android:id="#+id/tableRow8" android:layout_width="fill_parent">
<ImageView android:id="#+id/introImage" android:layout_height="wrap_content" android:layout_width="fill_parent" android:scaleType="fitStart" android:paddingLeft="8dip"></ImageView>
</TableRow>
<TableRow android:id="#+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:linksClickable="true" android:textColor="#color/Black" android:layout_height="wrap_content" android:focusable="false" android:text="more" android:autoLink="all" android:textColorLink="#color/Aqua" android:textSize="12dip" android:clickable="true" android:paddingRight="5dip" android:id="#+id/intro" android:paddingTop="5dip" android:focusableInTouchMode="false" android:paddingLeft="5dip" android:layout_width="wrap_content"></TextView>
</TableRow>
<TableRow android:id="#+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="#+id/description" android:text="description" android:visibility="invisible" android:paddingLeft="5dip" android:paddingRight="5dip" android:textColor="#color/Black" android:textSize="12dip" android:autoLink="all" android:clickable="true" android:linksClickable="true" android:textColorLink="#color/DarkGray"></TextView>
</TableRow>
</TableLayout>
</LinearLayout>
</TableRow>
<TableRow android:id="#+id/tableRow3" android:layout_height="wrap_content" android:layout_width="fill_parent" android:background="#drawable/listviewmenu" android:layout_gravity="center_horizontal" android:gravity="center_horizontal">
<LinearLayout android:layout_height="wrap_content" android:id="#+id/linearLayout1" android:layout_width="fill_parent" android:layout_gravity="center" android:gravity="center">
<Button android:id="#+id/mapClick" android:layout_height="wrap_content" android:text="#string/map_info" android:layout_width="wrap_content" android:background="#drawable/actionbutton" android:textColor="#color/White" android:textColorHighlight="#color/AntiqueWhite" android:textStyle="bold" android:gravity="center"></Button>
<Button android:id="#+id/moreClick" android:layout_height="wrap_content" android:text="#string/more_info" android:layout_width="wrap_content" android:textColor="#color/White" android:textColorHighlight="#color/Aqua" android:textStyle="bold" android:gravity="center" android:background="#drawable/actionmore"></Button>
</LinearLayout>
</TableRow>
</TableLayout>
The following is the same layout but use only one RelativeLayout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/white" >
<ImageView
android:id="#+id/icon"
android:layout_width="60dip"
android:layout_height="60dip"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="4px"
android:layout_marginRight="10px"
android:layout_marginTop="4px"
android:src="#android:drawable/dialog_frame" >
</ImageView>
<TextView
android:id="#+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/icon"
android:focusable="false"
android:focusableInTouchMode="false"
android:maxLines="10"
android:paddingTop="5dip"
android:text="#+id/label"
android:textColor="#android:color/black"
android:textSize="18dip" >
</TextView>
<TextView
android:id="#+id/distanceText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/title"
android:layout_gravity="left"
android:layout_toRightOf="#+id/icon"
android:gravity="center"
android:text="TextView"
android:textColor="#android:color/black"
android:textSize="12dip" >
</TextView>
<ImageView
android:id="#+id/introImage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/icon"
android:paddingLeft="8dip"
android:scaleType="fitStart" >
</ImageView>
<TextView
android:id="#+id/intro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/introImage"
android:autoLink="all"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:linksClickable="true"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:paddingTop="5dip"
android:text="more"
android:textColor="#android:color/black"
android:textColorLink="#android:color/primary_text_light"
android:textSize="12dip" >
</TextView>
<TextView
android:id="#+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/intro"
android:autoLink="all"
android:clickable="true"
android:linksClickable="true"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:text="description"
android:textColor="#android:color/black"
android:textColorLink="#android:color/darker_gray"
android:textSize="12dip"
android:visibility="invisible" >
</TextView>
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:background="#android:drawable/dialog_frame" >
<Button
android:id="#+id/mapClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:drawable/dialog_frame"
android:text="map_info"
android:textColor="#android:color/white"
android:textColorHighlight="#android:color/secondary_text_light"
android:textStyle="bold" >
</Button>
<Button
android:id="#+id/moreClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:drawable/dialog_frame"
android:gravity="center"
android:text="more_info"
android:textColor="#android:color/white"
android:textColorHighlight="#android:color/primary_text_light"
android:textStyle="bold" >
</Button>
</LinearLayout>
</RelativeLayout>
I just changed color, string and drawable references to see if it works!
RelativeLayout rulez!
It is suggested to keep the layouts of the ListView items simple - and by that I mean fast performing. Simple does not mean boring :)
RelativeLayouts are best for rows of a ListView since they require only one pass to render, as opposed to say, nested LinearLayouts (as mentioned here). However, if you must go beyond the simple and include a bit of fancy stuff in your rows, there are a couple of tricks provided by the platform to help you.
Use the convertView optimization - i.e, in the getView() method of your Adapter, check to see if the convertView parameter is null. If it isn't then just use that object, and modify it with new values instead of inflating a new one.
Even if you use option 1 above, use the ViewHolder pattern to not only avoid inflation; but also optimize the "modifying the row with new values" step. This is described in this talk.
I will just cut to the chase and paste all of my xml for a particular Activity below. The problem I'm having is that the widgets are not wrapping, and so much of the text is bleeding off the right edge of the screen.
As I'm using "wrap_content" for the width, I don't understand why this is happening.
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView
android:id="#+id/textViewSendLocWhenItChanges"
android:text="Send My Pterodactyl When It Changes"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<CheckBox
android:id="#+id/checkBoxSendToSelectedDuckbilledPlatypiWhenPterodactylChanges"
android:text="Send My Pterodactyl to Selected Duckbilled Platypi When It Changes" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<Button
android:id="#+id/buttonSendOnPterodactylChangedToSelected"
android:layout_weight="1"
android:text="Select Recipients From Contacts" />
<TextView android:layout_weight="1" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView
android:layout_span="1"
android:layout_weight="1"
android:text="Send Pterodactyl to selected Duckbilled Platypi from Contact List when my Pterodactyl changes by more than the following number of miles:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editTextMilesBeforeNotification"
android:layout_width="200px"
android:layout_span="1"
android:layout_weight="1" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView android:layout_height="10px" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView android:layout_height="20px" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView
android:id="#+id/textViewBuildStringOfWhoReceivesChangeOfPterodactylUpdates"
android:layout_width="wrap_content"
android:text="Your Pterodactyl will be immediately sent to "
android:textAppearance="?android:attr/textAppearanceSmall" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView android:layout_height="40px" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<Button
android:id="#+id/buttonNext"
android:layout_weight="1"
android:text="Save and Exit Keep In Touch Configuration" />
<TextView
android:layout_weight="1" />
</TableRow>
</TableLayout>
layout_width does not apply to TableRows. Use layout_span when you have a single column spanning two columns. Try using android:shrinkColumns. Hope it helps.