-2

How do i get the "Large Text" TextView above my TableLayout. (Red arrow)

Also, how do i close the gap between the rows in my TableLayout. (Brown arrow)

enter image description here

Daniel
  • 2,355
  • 9
  • 23
  • 30
psyko666
  • 43
  • 6
  • Please post your xml for this layout so we can better assist you. – prolink007 Aug 02 '12 at 16:12
  • Just edited my answer with more details, please try what i have posted. It should solve your issues. – prolink007 Aug 02 '12 at 16:24
  • sorry for the late reply, i always forget to accept. – psyko666 Jan 06 '13 at 10:37
  • People may not have down voted because you did not vote, they may have down voted because there is another issue with your question. Or it may already be very similar to other posts on SO. I am not sure why there is down votes, but i highly doubt it is because you forgot to accept an answer. – prolink007 Jan 07 '13 at 14:30

2 Answers2

1

You have two choices. You could put them both in either a RelativeLayout, or a LinearLayout. If you put them in a RelativeLayout, you need to just give the text android:layout_above="@id/tablelayout". If you want to use LinearLayout, set the orientation to vertical and just throw them in there.

For the gap, you probably have some padding somewhere. It's kind of hard to tell without seeing code.

Michael
  • 3,334
  • 20
  • 27
0

To fix the row padding issue:

You will need to adjust the padding for each TableRow, please look at the TableRow tags in the xml below. There are different types of padding offered. Just look at the ones offered and decide what is best for your situation.

To solve the TextView "LargeText" issue:

Use a LinearLayout and put the TextView above the TableLayout with a vertical orientation on the LinearLayout, please view the layout xml below.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        style="@android:style/TextAppearance.Large"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="LargeText" />

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <TableRow>

            <TextView
                android:padding="0dp"
                android:text="row1_a" />
        </TableRow>

        <TableRow>

            <TextView
                android:padding="0dp"
                android:text="row2_a" />
        </TableRow>
    </TableLayout>

</LinearLayout>
prolink007
  • 33,872
  • 24
  • 117
  • 185
  • thanks sorry if it's late, i always forget to check back on stackoverflow and accept, i solved my problem, when i got back it's almost the same as yours, thank you again. – psyko666 Jan 06 '13 at 10:50