Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove bottom line from TextInputEditText

Tags:

I need to remove the bottom line of TextInputEditText I set background to transparent and null but nothing is working.

<com.google.android.material.textfield.TextInputLayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:background="@drawable/bg_textinput_layout"     android:hint="@string/app_name">      <com.google.android.material.textfield.TextInputEditText         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="@color/transparent"/>  </com.google.android.material.textfield.TextInputLayout> 

The bg_textinput_layout

<?xml version="1.0" encoding="utf-8"?>  <shape xmlns:android="http://schemas.android.com/apk/res/android">  <solid android:color="@color/white"/>  <stroke android:width="@dimen/spacing_1"     android:color="@color/hint_text_color"/> </shape> 
like image 403
Balaji Avatar asked Sep 24 '19 11:09

Balaji


People also ask

How do I get rid of TextInputLayout bottom line?

in the TextInputLayout, set app:boxStrokeWidth="0dp" in the TextInputEditText, set app:boxBackgroundColor="@color/white" . it worked for me when my background is white.

What is TextInputLayout?

TextInputLayout is a view container that is used to add more features to an EditText. It acts as a wrapper for EditText and has some features like: Floating hint. Animation that can be disabled or enabled. Error labels that display error messages when an error occurs.


1 Answers

You can apply app:boxStrokeWidth="0dp" and app:boxStrokeWidthFocused="0dp" (or theapp:boxStrokeColor attribute using a selector with the same values of the boxBackgroundColor).

   <com.google.android.material.textfield.TextInputLayout        app:boxStrokeWidth="0dp"        app:boxStrokeWidthFocused="0dp"        ...> 

enter code here

For a white box without background and border:

<com.google.android.material.textfield.TextInputLayout     app:boxStrokeWidth="0dp"     app:boxStrokeWidthFocused="0dp"     app:boxStrokeColor="#FFF"     app:boxBackgroundColor="#FFF"     ...> 

enter image description here

like image 68
Gabriele Mariotti Avatar answered Sep 21 '22 07:09

Gabriele Mariotti