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)
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)
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.
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>