XML : Can't adjust weights in linear layout - android


I've searched but couldn't figure out the problem.

enter image description here

I want to make exactly like the above picture. I've used linear layout in vertical for the "Day Teams Score Status" And then for the content containing the values of above headings, I've used a listview.

What I've achieved is that headings "Day Teams Score Status" are being shown with spaces but the contents ( which are in seperate .xml file ) are not being shown with spaces, so what I'm getting is:

enter image description here

The adapter xml file for the list view is:

adapter_my_matches.xml

  <?xml version="1.0" encoding="utf-8"?>  <LinearLayout      android:layout_width="match_parent"      android:layout_height="wrap_content"      xmlns:android="http://ift.tt/nIICcg"      xmlns:tools="http://ift.tt/LrGmb4"      >          <TextView          android:layout_width="0dp"          android:layout_height="wrap_content"          android:textAppearance="?android:attr/textAppearanceMedium"          android:text="Date"          android:id="@+id/textViewDate"          android:layout_weight="0.1"          android:layout_gravity="center_vertical" />        <LinearLayout          android:id="@+id/ll"          android:layout_width="0dp"          android:layout_height="wrap_content"          android:orientation="vertical"          android:layout_weight="0.4">          <TextView              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:textAppearance="?android:attr/textAppearanceMedium"              android:text="Teams"              android:id="@+id/textViewTeams1"/>          <TextView              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:textAppearance="?android:attr/textAppearanceMedium"              android:text="Teams"              android:id="@+id/textViewTeams2"/>      </LinearLayout>        <TextView          android:layout_width="0dp"          android:layout_height="wrap_content"          android:textAppearance="?android:attr/textAppearanceMedium"          android:text="Score"          android:id="@+id/textViewScore"          android:layout_weight="0.1"          android:layout_gravity="center_vertical" />        <TextView          android:layout_width="0dp"          android:layout_height="wrap_content"          android:textAppearance="?android:attr/textAppearanceMedium"          android:text="Status"          android:id="@+id/textViewStatus"          android:layout_weight="0.2"          android:layout_gravity="center_vertical" />  </LinearLayout>    

No comments:

Post a Comment