1

I need to remove ellipsize(three dots) from my hint text and want to show complete text. I am using TextInputLayout widget.

Adding ellipsize attribute to TextInputEditText does not work.

enter image description here

Below is the code for TextInputLayout Widget

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    style="@style/TextLabel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <include
        android:id="@+id/layout_header"
        layout="@layout/text_header" />

    <com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/hint"
        style="@style/TextLabel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="fields"
        android:padding="@dimen/padding_normal"
        app:boxBackgroundColor="@color/white">


        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/edit_text"
            android:singleLine="false"
            android:ellipsize="none"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28
Taha Asif
  • 333
  • 6
  • 24

1 Answers1

1

TextInputLayout not showing the whole line. It draw the hint text and measure width from visible text character length. And it uses CollapsingTextHelper that measure the text. So it is not possible to show multipleLine hint in textInput layer.

But you can show multi line hint without using floating hint. For that: set hint in your TextInputEditText and

set android:hint="\n" int your TextInputLayout.

Tariqul Islam
  • 680
  • 6
  • 14
  • Your answer is correct to much extend. But still if I set my hint in TextInputEditText, it does not fit in completely. This problem rises due to the fact that my hint is long enough. – Taha Asif Aug 05 '19 at 05:12