Android: TextView automatically truncate and replace last 3 char of String
You should be able to use the "ellipsize" property of a text view:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text_mytext"
android:ellipsize="end"
android:maxLines="1"
/>
You may also need to apply gravity values to the layout too; I have sometimes seen "auto-stretching" views without them.
Android: Something better than android:ellipsize=end to add ... to truncated long Strings?
See my update 3. The workaround was using " marquee". I have seen many apps doing that at this time.
Now, with new versions of Android this feature is most likely fixed and will work as expected. (my guess)
Adding '...' at end of a string in android in TextViews
Add these attributes to your TextView
to restrict your TextView's
text in one line and to add 3 dots ...
at the end of line.
android:singleLine="true"
android:ellipsize="end"
TextView setText problem
Try adding this to your TextView (marquee or end):
android:ellipsize="marquee"
You may also need:
android:scrollHorizontally="true"
Without scrollHorizontally="true" you may still get the text wrapped rather than appended with ... I use these very 2 lines to display a list view in my app. The 3 long lines I have get appended correctly.
Related Topics
How to Connect Android with MySQL Using MySQL Jdbc Driver
Android Classnotfoundexception
How to Get Elements of Fragments Created by Viewpager in Mainactivity
Openssl Is Not Recognized as an Internal or External Command
Get Application Context from Non Activity Singleton Class
Android.App.Application Cannot Be Cast to Android.App.Activity
Retrofit and Rxjava: How to Combine Two Requests and Get Access to Both Results
Fatal Signal 11 (Sigsegv) at 0X00000000 (Code=1) - Phonegap
Android - Copy Assets to Internal Storage
Alertdialog with Custom View: Resize to Wrap the View's Content
How to Save an Image in Android Q Using Mediastore
How to Use Parameters with Httppost
Android: Countdowntimer Skips Last Ontick()!
Convert Utc into Local Time on Android