Below is TextView 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 ellipsize text when text length is greater than 30 chars but its not working at all.please check if i am missing anything.i tried answers posted for similar question but it did not work.
I have Changed MaxLength to MaxEms in your TextView its Working now use this.
<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" />
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