Answer the question
In order to leave comments, you need to log in
Can't display data in TextView (ListView)?
We have a ListView, and we also have this layout for the ListView elements (row.xml):
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android=" schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_gravity="top">
- <ImageView android:id="@+id/itemicon"
- android:src="@drawable/icon"
- android:layout_marginLeft="4dp"
- android:layout_marginRight="8dp"
- android:layout_height="30dp"
- android:layout_marginTop="8dp"
- android:layout_width="30dp">
- </ImageView>
- <TextView
- android:layout_height="wrap_content"
- android:id="@+id/label"
- android:textSize="25dp"
- android:layout_marginTop="6dp"
- android:layout_width="fill_parent"
- android:textColor="#000000">
- </TextView>
- <TextView
- android:id="@+id/labeldesc"
- android:textSize="14dp"
- android:layout_marginTop="2dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textColor="#000000">
- </TextView>
- </LinearLayout>
Answer the question
In order to leave comments, you need to log in
The TextView (label) takes up the remaining width of the LinearLayout after the ImageView, so the second TextView (labeldesc) just doesn't fit.
If you change the label's layout_width to wrap_content, then the text in the labeldesc will be visible (unless the text in the label takes up the full width).
If you want @+id/label to occupy the entire free area before @+id/labeldesc then add to the label android:layout_weight="0.9"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question