I'm trying to make a simple listView with string objects only inside dialog; the problem is the list item is not width match_parent
as i set:
the list view is the root element:
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#ff0000"
android:id="@+id/lvLinks"
android:layout_height="match_parent"/ >
list item:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:padding="7dp"
android:textSize="15sp"
android:background="#0000ff"
android:layout_height="match_parent" />
adapter:
ListView lv = (ListView) findViewById(R.id.lvLinks);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item_links,items);
lv.setAdapter(adapter);
I've tested it on many OS, this is not the problem
FIXED: answer
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#ff0000"
android:id="@+id/lvLinks"
android:layout_height="match_parent" />
</LinearLayout>
DialogFragment
? – Botch