When I set android:background="@android:color/transparent, it sets the background transparency of the buttons, but the outline of the button disappears. How to set it so that the background is transparent, but still have an outline?
android:background="@android:color/transparent
You can use a custom selector that uses different nine patch images for different button states.
This link may be useful.
You can use this image ...
Hope this helps.
One approach is to make a 9 patch that has a border but transparency in the middle.
Here is an example:
11x11 2 . png draw9patch , pppppppppppp
android:background="@drawable/bground"
9- "bground", , , , .