0

This question is based off my other one. Why is each element in the table row still taking the same amount of space

The problem wasn't due to the default margin of buttons or the layout_width attribute. IS there just some property of table row that won't let layout_weight work? If so, is there any other attribute I can use to deal with this issue. I know I cannot use layout_span because that involves two rows.

Community
  • 1
  • 1
committedandroider
  • 8,711
  • 14
  • 71
  • 126

1 Answers1

0

Check this it works..

<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent" >

<TextView
    android:id="@+id/stockView"
    android:layout_width="0dip"
    android:text="TextView"
    android:layout_weight="2" />

<Button
    android:id="@+id/stockQuote"
    android:layout_width="0dip"
    style="?android:attr/buttonStyleSmall"
    android:text="get_stock_quote"
    android:layout_weight="1" />

<Button
    android:id="@+id/webStock"
    android:layout_width="0dip"
    style="?android:attr/buttonStyleSmall"
    android:text="go_to_website"
    android:layout_weight="1"  />