I have search the internet and so on but couldnt find a solution for my problem. I'm creating a listview and setting an adapter:
myListView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, theStringList));
theStringList is a simple LinkedList<String> with items.
and the android.R.layout.simple_list_item_1 is:
<TextView android:id="@android:id/text1" 
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content" 
  android:textAppearance="?android:attr/textAppearanceLarge" 
  android:gravity="center_vertical" 
  android:paddingLeft="6dip" 
  android:minHeight="?android:attr/listPreferredItemHeight"/>;
problem: the listView items only fit the text but NOT the whole screen?!?!?
How are you creating your ListView? Is it defined in XML? Are you using a ListActivity? Or are you creating it programmatically? You need to make sure that the ListView itself has a width of fill_parent.
Who is the parent view of your TextView? Check the settings for that one too, maybe it's a fixed width smaller than the screen or seted to "wrap_content" .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With