I have a ListView
with some custom layout for the row (an image, then two lines of text using two TextView
in a vertical LinearLayout
, see code below)
My problem is that when I dynamically change the text size (in the getView
method of the Adapter
), the text size does change, but the size of the TextView
that wraps it doesn't.
Here is a picture of what it does when I set the size to something "higher" than the default (picture is with 18). Despite the large number of threads or questions that seem similar, I haven't found a solution to that.
Here is the layout of my list row:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="4dp">
<ImageView android:id="@+id/entries_list_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"/>
<LinearLayout android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView android:id="@+id/entries_list_item_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="@color/entries_list_item_name"/>
<TextView android:id="@+id/entries_list_item_summary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:textColor="@color/entries_list_item_summary"/>
</LinearLayout>
</LinearLayout>
I tried switching the heights to 0dip
as suggested elsewhere, it didn't change a thing.
EDIT The ListView
itself is very basic:
<ListView android:id="@+id/entries_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>