CAPTCHAPhoto by <a href="https://unsplash.com/@markusspiske" rel="nofollow">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=android-blog&utm_medium=referral" rel="nofollow">Unsplash</a>

Here is simple snippet for making imitation of underline for textview. To use it – just set it as a textview’s background.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:background="#EDF5F5">
    <item
        android:bottom="10dp"
        android:gravity="bottom"
        android:left="4dp"
        android:right="4dp">
        <shape>
            <corners android:radius="1dp" />
            <size android:height="2dp" />
            <solid android:color="#FF0000" />
        </shape>
    </item>
</layer-list>

Preview:

sorsare

By sorsare

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :