Faber Fedor wrote:
> I've got two buttons, editEndDate and editEndTime, in a table row. 
> editEndDate takes up 25% of the row while the rest is taken up by
> editEndTime.  I want the reverse, but nothing I do seems to make any
> difference (this is why I hate CSS too!).  Here's the XML:
> 
> <TableRow
> android:id="@+id/widget62b"
> android:layout_width="fill_parent"
> android:layout_height="wrap_content"
> android:orientation="horizontal"

Per the documentation:

"The children of a TableRow do not need to specify the layout_width and
layout_height attributes in the XML file. TableRow always enforces those
values to be respectively FILL_PARENT and WRAP_CONTENT."

>     <Button
>     android:id="@+id/editEndDate"
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content"
>     android:textSize="18sp"
>     android:layout_alignParentLeft="true"
>     android:layout_weight="20"
>     >
>     </Button>
>     <Button
>     android:id="@+id/editEndTime"
>     android:layout_width="wrap_content"
>     android:layout_height="wrap_content"
>     android:textSize="18sp"
>     android:layout_alignParentRight="true"
>     android:layout_weight="2"
>     android:layout_toRightOf="@id/editEndDate"
>     >
>     </Button>
> </TableRow>
> 
> You can see that editEndDate should be ridiculousl larger than
> editEndTime but the same 25/75 ration exists.

In this case, you don't need the layout_width, layout_height, and
layout_weight, since none will be honored, since you're in a TableRow,
not a LinearLayout.

To control which columns take up any "extra" space, use the
android:stretchColumns attribute on the TableLayout that presumably
wraps the TableRow somewhere.

What you can't do is specify precise proportions of space with a
TableLayout, AFAIK.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to