This property makes
"short and very long word"
to
"short and
. But I want to have something. as
"short and very long ..."
Right now I'm truncating a line in Java code. However, this depends on the number of characters, and not on the actual length of the link. So, the result is not very pleasant.
String title; if(model.getOrganization().length() > 19) { title = model.getText().substring(0, 15).trim() + "…"; } else { title = model.getText(); } ((TextView) findViewById(R.id.TextViewTitle)).setText(title);
Update
Just noticed, this property actually adds "..." in several cases. But not in all of them:
12345678901234567890 becomes "12345678901234 ..."
However
"1234567890 1234567890" becomes "1234567890" and not "1234567890 123 ..."
Update 2
Now it's really funky! I just set singleLine = true and removed maxLine (an error appears with and without the ellipsize attribute) ...

This is a screenshot from Motorola Milestone with android 2.1 update. The same thing happens with HTC Desire with the same version of Android.
Update 3
Now I am using android: ellipsize = "marquee". This seems to be the only correct working setting. It also moves only when focusing. I also see this in many other applications. I assume this is a common practice.
android string android-layout layout truncate
OneWorld Sep 22 '10 at 12:19 2010-09-22 12:19
source share