Here I am writing code to create transparent button with border.
First create xml file transparent_button.xml for selector where I am describing the properties of button like border width, color etc
<!--?xml version="1.0" encoding="utf-8"?-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#00ffffff"/>
<stroke android:color="@android:color/white" android:width="1dp"/>
<corners android:radius="4dp"/>
</shape>
</item>
Then use Button like this
<button android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@mipmap/transparent_button" />
0 Comment(s)