Ha that's the same exact control I'm looking to create, multiline and
if it spills over three vertical lines, replace the last few
characters with an ellipsis and "More" text - the user clicks that and
the textview expands to full height.

I have written this kind of control for blackberry but was hoping
there'd be something already premade in android. I'll check out the
source of TextView as a starting point. Thanks for your help and
confirming this.

On Oct 21, 12:31 pm, "nEx.Software" <[email protected]>
wrote:
> 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 <[email protected]> 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 <[email protected]> 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<[email protected]> 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 <[email protected]> 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<[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to