In my Android app, I'm trying to set a simple ring shape as the background for my buttons. But as far as I try, the XML preview ignores the background drawing unless the API level is set to 20 (Android L)
What's happening? I am sure that people usually set the shapes for the buttons to L.
The code for my XML form for button_ring.xmlis located in the / drawables folder
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring" >
<solid android:color="#4CD964" />
</shape>
and the code for my button defined in the layout folder
<Button
android:id="@+id/button5"
android:layout_weight="1"
android:text="@string/five"
android:tag="@string/five"
style="@style/CustomButton"
android:background="@drawable/button_ring" />
My Gradle Addiction
dependencies {
compile 'com.android.support:support-v4:20.+'
}
and finally a video to see what I mean: Video