Reputation: 1
How to set android:foreground
drawable of a button borderless in Android development? Like in case of android:background="?android:attr/selectableItemBackgroundBorderless"
.
Upvotes: 0
Views: 380
Reputation: 1057
Well you can use multiple approches
1. android:background="@android:color/transparent"
2. android:background="?android:attr/selectableItemBackground"
3. style="?android:attr/borderlessButtonStyle"
or
4. android:background="@drawable/btn_borderless"
in 4th approch you will require a xml file btn_borderless in your drawable folder such as
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
</shape>
I got this answer from https://inducesmile.com/android-programming/how-to-create-borderless-button-in-android/
and your question may be possible duplicate of How to create borderless button using style from style.xml file (along with all other styles)
Upvotes: 1