Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Positioning hint within multiline EditText - TextInputLayout

I have an EditText that has 4 lines (min=4; >4 scrolls). The EditText is embedded in a TextInputLayout. The hint displayed for this seems to be centered vertically. I'd like it at the start of the 1st line, naturally.

Important Edit: Testing without TextInputLayout allows for the hint to be positioned effectively. The problem lies with this. Any insight into how to resolve it is appreciated.

<android.support.design.widget.TextInputLayout
    android:id="@+id/text_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusableInTouchMode="true">

    <EditText
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:fadeScrollbars="false"
        android:gravity="left"
        android:hint="What's going on?"
        android:inputType="textMultiLine"
        android:lines="4"
        android:minLines="4"
        android:scrollbarStyle="outsideInset"
        android:scrollbarThumbVertical="@drawable/custom_scrollbar_style"
        android:scrollbars="vertical"
        android:textColorHint="@color/black_semi_transparent" />

    <TextView
        android:id="@+id/text_count"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:text="140"
        android:textColor="@color/black_semi_transparent" />

</android.support.design.widget.TextInputLayout>

Comparison of EditText

like image 577
McGuile Avatar asked Oct 20 '22 08:10

McGuile


1 Answers

This bug has been fixed in the v23 support libraries:

https://code.google.com/p/android/issues/detail?id=179720

like image 137
Greg Ennis Avatar answered Nov 03 '22 03:11

Greg Ennis