Renz Manacmol
Renz Manacmol

Reputation: 939

Android TextInputLayout remove extra space below edittext

I'm using TextInputLayout.FilledBox.Dense as style for my TextInputLayout and then I disable the hint by adding hintEnabled=false but then It adds extra line at the bottom of EditText

Code snippet

<android.support.design.widget.TextInputLayout
            android:id="@+id/name_text_input"
          style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:hintAnimationEnabled="false"
            app:hintEnabled="false">

            <EditText
                android:id="@+id/login_tab_userid3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:imeOptions="actionNext"
                android:inputType="textPersonName" />

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

Screenshot

Screenshot

Upvotes: 2

Views: 1024

Answers (2)

Ravindra Kushwaha
Ravindra Kushwaha

Reputation: 8042

You can remove the line below the your EditText from this android:background="@null" and then creating the View below your EditText for creating the line below the EditText

            <EditText
                android:layout_width="match_parent"
                android:background="@null"
                android:layout_height="wrap_content" />

            <View
                android:layout_width="match_parent"
                android:background="@android:color/white"
                android:layout_height="0.5dp"/>

Upvotes: 1

EliodeBeirut
EliodeBeirut

Reputation: 104

In your editText

Put this line : android:background="@null"

Upvotes: 0

Related Questions