0

https://i.stack.imgur.com/4Irb3.png

click above link for screen shot.

Ok so i'm having some problems editing my xml layout to get this list looking good. Basically i want each row of info to fill the whole list row, so that the white space you see in between each row isn't there. I have tried manipulating multiple different attributes in the row.xml and the main.xml but nothing has worked so far. Anyone have any advice? Thanks

row.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:paddingTop="4dip"
     android:paddingBottom="6dip"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:textColor="@color/white" 
     android:orientation="horizontal">

     <TextView android:id="@+id/position"
         android:textColor="@color/white"
         android:background="@color/black"
         android:layout_width="20dip"
         android:textSize="14dip"
         android:gravity="center"
         android:layout_height="fill_parent"/>

     <TextView android:id="@+id/team_name"
         android:textColor="#000000"
         android:background="@color/grey"
         android:gravity="center"
         android:layout_width="70dip"
         android:textSize="14dip"
         android:layout_height="fill_parent" 
         android:layout_weight="1"/>

     <TextView android:id="@+id/games_played"
         android:textColor="#000000"
         android:background="@color/cyan"
         android:layout_width="5dip"
         android:textSize="14dip"
         android:gravity="center"
         android:layout_height="fill_parent"  
         android:layout_weight="1"/>

      <TextView android:id="@+id/points"
         android:textColor="#000000"
         android:background="@color/turquoise"
         android:layout_width="5dip"
         android:textSize="14dip"
         android:gravity="center"
         android:layout_height="fill_parent"  
         android:layout_weight="1"/>
</LinearLayout>

main.xml

<?xml version="1.0" encoding="utf-8"?>
    <TableLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1">
    <TableRow>
     <TextView 
        android:text="Team"
        android:background="@color/red"
        android:textColor="@color/white" 
        android:gravity="right"
        android:layout_width="wrap_content" />
    <TextView 
        android:text="Games Played"
        android:background="@color/red"
        android:textColor="@color/white" 
        android:gravity="center"
        android:layout_width="wrap_content"
        android:paddingLeft="22dip" />

    <TextView 
        android:text="Points"
        android:background="@color/red"
        android:textColor="@color/white" 
        android:gravity="left"
        android:layout_width="wrap_content"
        android:paddingRight="18dip"/>
    </TableRow>

    <TableRow >
    <ListView
        android:background="@color/white" 
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:layout_weight="1"/>
    </TableRow>
</TableLayout>
conorw89
  • 45
  • 1
  • 8
  • 2
    Without source code to your layouts, it will be difficult for anyone to assist you. – CommonsWare Feb 22 '12 at 23:41
  • ok thanks, i was going to add the source code initially, but thought that it would be quite clear what was wrong for someone that knows about this just from viewing the picture, my mistake! – conorw89 Feb 23 '12 at 00:37

2 Answers2

0

Did you set android:minHeight prop as well as android:layout_height of LinearLayout? this will fixes the row height.

Kurosawa Hiroyuki
  • 1,217
  • 2
  • 14
  • 22
0

i figured it out, i had to remove the padding attributes in the linearlayout, can't believe i didn't figure it out before!

conorw89
  • 45
  • 1
  • 8