Android create a "flat button"
Add dependency to build.gradle
dependencies {
compile 'com.android.support:appcompat-v7:25.0.0'
}
Then in your layout XML file, add a style attribute to the Button
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
style="@style/Widget.AppCompat.Button.Borderless"/>
You can change the color when the button is pressed by defining a custom style
<style name="FlatButtonStyle" parent="Theme.AppCompat.Dark">
<item name="colorControlHighlight">@color/transparent</item>
</style>
and applying this style in layout XML
android:theme="@style/FlatButtonStyle"
You can use the style="?android:attr/borderlessButtonStyle
on your Button
as follows:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextGoesHere"
style="?android:attr/borderlessButtonStyle"
/>
BorderlessButtonStyle
Style for buttons without an explicit border, often used in groups.
Also you can use those Flat Buttons