0

This is my XML element for the TextView:

<TextView
    android:id="@+id/todo_notes"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ellipsize="end"
    android:maxLines="3"
    android:textAppearance="@style/TextAppearance.AppCompat.Body1"
    tools:text="This is a long description of what has to be done to make this task complete. It might only be one or two words (if the title is specific enough), or it might be a whole lot more than that." />

It's contained within a vertical LinearLayout (as you might be able to guess from the screenshots).

This is how it looks:

Ellipsis is replacing the entire last line, instead of being at the end of it

This is how I want it to look:

Ellipsis is at the end of the line, instead of at the beginning with nothing after it.

In short, I want the ellipsis to be at the end of the last line, rather than replacing the last line. How can I make this happen? I'd prefer a solution that doesn't require any Java, but if that's not possible, I'm fine with it.

I'm on Android Studio 3.0.1, looking at it with API 27. I can reproduce this error by just copy-and-pasting the <TextView> into a blank (aside from the <?xml> header) file, with a narrow enough screen size that the text wraps onto more than three lines.

Nic
  • 6,211
  • 10
  • 46
  • 69

1 Answers1

2

It seems like the following topic answers to your question: Setting Ellipsize on TextView reduces lines shown by one (instead of only ellipsizing last) One answer suggests it's only a bug of a previewer.

taurusx
  • 33
  • 3
  • That looks promising! You don't have enough rep now, but once you do (one more upvote on a question or answer), you should flag questions like mine as duplicates. You'll see a little grey link under the tags to "flag"; clicking that will pop up a menu. One of the options will be "is a duplicate", and you can put the URL in there. – Nic Dec 27 '17 at 22:49
  • I just remembered that I can close my own questions, lol. Whoops. – Nic Sep 06 '18 at 21:17