I have ellipsize working for multiline text. I had to write my own
ellipsize function to do it. I wanted to replace the "..." with
"...Read More" so my implementation is highly customized. A tip, you
can clone the ellipsize function from the AOSP then use it directly.
The problem appears to be not in the ellipsize code itself but in
somewhere in how the TextView tells its size to the ellipsize
function. I have not tracked down exactly where this is happening and
since I don't have a build environment setup for AOSP, it would be
hard for me to test it anyway. I should revisit my implementation and
see if I can clean it up for more generic use.

On Oct 21, 8:30 am, Mark Wyszomierski <mar...@gmail.com> wrote:
> Ok, that confirms what I'm seeing. I wonder if there really is a way
> to get the ellipsis to work for multiline text. If not, I will have to
> write a widget for it unfortunately!
>
> Thanks
>
> On Oct 20, 12:37 pm, Wouter <wouterg...@gmail.com> wrote:
>
> > Yes I have searched this also before and this also works for single
> > line text so i think you have to use it this way..
>
> > Wouter
>
> > On Oct 20, 6:23 pm, MarkWyszomierski<mar...@gmail.com> wrote:
>
> > > Hi Wouter,
>
> > > Yes that does work for single line text, but not for multiline -
> > > checking from other posts here it seems like the ellipsis does not
> > > handle multiline text correctly?
>
> > > Thanks
>
> > > On Oct 20, 12:06 pm, Wouter <wouterg...@gmail.com> wrote:
>
> > > > I use this in my layout xml file:
>
> > > > android:ellipsize="end"
> > > > android:singleLine="true"
>
> > > > And this works perfectly for text on 1 line..
>
> > > > On Oct 20, 5:42 pm, MarkWyszomierski<mar...@gmail.com> wrote:
>
> > > > > Hi,
>
> > > > > I have a normal TextView which has multiple lines. I set its max
> > > > > number of lines to 3. I'd like it to show an ellipsis at the end if
> > > > > the text is too long:
>
> > > > >   TextView tv = new TextView(context);
> > > > >   tv.setLines(tv);
> > > > >   tv.setText("some really long text...");
>
> > > > > I tried the set ellipsis calls but it doesn't seem to do anything -
> > > > > the text appears the same way. How do we get this to work?
>
> > > > > Thanks
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to