3 dots in the end of TextView are vertically centered

Viewed 173

When using android:ellipsize="end" property, 3 dots are vertically centered instead of appearing in the bottom of the view.

How should I make 3 dots appear in the bottom?

<TextView
        android:id="@+id/widgetTitle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        tools:text="@string/lorem_ipsum_short"
        android:maxLines="1"
        android:ellipsize="end"
        android:layout_marginStart="@dimen/spacing_4"
        android:paddingEnd="@dimen/spacing_2"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toStartOf="@id/widgetTimeArrived"
        app:layout_constraintStart_toStartOf="parent"
        />

How it looks

2 Answers

It's hard to tell without access to your full layout, but that's not the standard behavior, so you may be using a custom Font/Theme.

This is how it looks in a blank layout with a ConstraintLayout:

TextView with IDE/XML code and preview visible on the right

Notice I pinned the "end" to the parent, since I don't know what your widgetTimeArrived is.

I am getting your expected results by implementing your code. I think @Martin Marconcini is right about some custom theme or it might be some views alignment or constraint issue.Your full xml might be helpful to understand that.

Here are the results:

enter image description here

Related