Search code examples
androiduser-interfacetextviewmaterial-design

The best way to create a TextView that looks like this


I'm trying to recreate this type of TextView. Is it Material Design TextInput or modified TextView? How Can I put the line on top of TextView? Thank you.

enter image description here


Solution

  • This is just a view with background property. Use it like this:

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:orientation="vertical">
    
        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/black"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="View line placed above the text view"
            android:layout_marginTop="5dp"/>
    
    </LinearLayout>
    

    enter image description here