Created
May 4, 2015 19:10
-
-
Save fatorx/d5d0a41ab49511e591f7 to your computer and use it in GitHub Desktop.
Android - Criar um Button sublinhado
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<gradient | |
android:angle="90" | |
android:startColor="#f00" | |
android:centerColor="@android:color/transparent" | |
android:centerX="0.01" /> | |
</shape> | |
<!-- | |
Para mudar a posição da borda (não necessariamente ser sublinhado) | |
0 = left | |
90 = bottom | |
180 = right | |
270 = top | |
Referência: http://stackoverflow.com/a/23754336/1222311 | |
--> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Button | |
android:text="@string/title_btn" | |
android:layout_width="150dp" | |
android:layout_height="match_parent" | |
style="@style/linksActive" | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<style name="linksActive"> | |
<item name="android:background">@drawable/bg_shape</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment