I have an xml layout which serves as an item in a ListView. The thing is: when it's added there, the item's width isn't stretched to match_parent, it wraps content instead. It is used in a ListView, so its width needs to be match_parent. I've been reading about it all over stackoverflow, trying every solution availible, but I have had zero result: layout_weight set to 1 does nothing to my layout, stretching columns has given me the best result in terms of width, but in terms of layout itself it failed miserably.
Is there anything that can be done here?
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<TableRow
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<CheckBox
android:id="@+id/trackCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:clickable="false"
android:duplicateParentState="true" />
<TextView
android:id="@+id/trackNumberText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="00."
android:textColor="@android:color/black"
android:textSize="18sp" />
<TextView
android:id="@+id/trackTitleText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_weight="1"
android:text="Title"
android:textColor="@android:color/black"
android:textSize="18sp" />
</TableRow>
<TableRow
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/trackArtistText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_weight="1"
android:text="Artist" />
</TableRow>
</TableLayout>