Skip to content

Instantly share code, notes, and snippets.

@zi6xuan
Last active February 20, 2018 01:25
Show Gist options
  • Save zi6xuan/4249ead3497cf09e6d6b95fcd02452eb to your computer and use it in GitHub Desktop.
Save zi6xuan/4249ead3497cf09e6d6b95fcd02452eb to your computer and use it in GitHub Desktop.
通过shape绘制矩形,实现下划线,通过填充矩形实现的方法不太好,因为有背景色存在,这个方法只有下划线背景是透明的
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="1px"
android:left="-2px"
android:right="-2px"
android:top="-2px">
<shape>
<stroke
android:width="1px"
android:color="@color/colorAccent" />
</shape>
</item>
</layer-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment