Why Is Each Element In The Table Row Still Taking The Same Amount Of Space
Here is what I am getting when I run my application on my device The part that I have problems with is the rows - with text, quote, and web. I dynamically inserted those rows into
Solution 1:
Check this it works..
<?xml version="1.0" encoding="utf-8"?><TableRowxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"android:background="@android:color/transparent" ><TextViewandroid:id="@+id/stockView"android:layout_width="0dip"android:text="TextView"android:layout_weight="2" /><Buttonandroid:id="@+id/stockQuote"android:layout_width="0dip"style="?android:attr/buttonStyleSmall"android:text="get_stock_quote"android:layout_weight="1" /><Buttonandroid:id="@+id/webStock"android:layout_width="0dip"style="?android:attr/buttonStyleSmall"android:text="go_to_website"android:layout_weight="1" />Solution 2:
You should play with layout_span. Try to add android:layout_span="2" to your textview.
What is the equivalent of "colspan" in an Android TableLayout?
Post a Comment for "Why Is Each Element In The Table Row Still Taking The Same Amount Of Space"