TextView Ellipsize not working
Below TextView is defined in xml.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Select Language"
android:singleLine="true"
android:maxLines="1"
android:maxLength="30"
android:ellipsize="end"
android:padding="4dp"
android:textAppearance="?android:textAppearanceMedium"
android:textColor="@android:color/holo_blue_dark"
android:id="@+id/selected_language" />
I want to ellipse the text when the text is more than 30 characters long, but its not working at all. Check if I am missing anything. I tried the answers posted for a similar question, but it didn't work.
+3
source to share
3 answers
I have MaxLength for MaxEms in your TextView, this works now.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Select Language"
android:singleLine="true"
android:maxLines="1"
android:maxEms="30"
android:ellipsize="end"
android:padding="4dp"
android:textAppearance="?android:textAppearanceMedium"
android:textColor="@android:color/holo_blue_dark"
android:id="@+id/selected_language" />
+2
source to share