title: How to make an underline below TextView and EditText in Android
body: <p>I want to achieve something like this, I am able to do just TextView but with EditText adjacent to it, I am stuck.</p>
  
  <p>Here is my code so far - </p>
  
  <p>Drawable - </p>
  
  <pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
         android:shape="line"&gt;
      &lt;stroke android:color="#3F51B5" android:width="2dp"/&gt;
      &lt;padding android:top="-30dp" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>Layout - </p>
  
  <pre><code>                android:layout_width="match_parent"
                  android:layout_height="40dp"
                  android:background="@drawable/signup_screen_input_field"
                  android:layout_marginTop="20dp"
                  android:orientation="horizontal"&gt;
  
              &lt;TextView
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:gravity="center"
                      android:padding="5dp"
                      android:text="UserName"
                      android:textColor="@android:color/black"/&gt;
  
              &lt;EditText
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:background="@android:color/transparent"
                      android:gravity="center"
                      android:hint="John Doe"
                      android:padding="5dp"
                      android:textColor="@android:color/white"
                      android:textColorHint="@android:color/white"/&gt;
  
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Also my code is hacky, which isn't good. 
  The image of what I am trying to achieve - 
  <a href="https://i.stack.imgur.com/mCKgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mCKgK.png" alt="enter image description here"></a></p>