Der Ripple-Effekt auf shape drawable

Versuchen, etwas zu tun, wirklich einfach und sah einen Haufen der SO Mittel, aber ohne Erfolg. Ich werde versuchen, den ripple-Effekt auf eine Schaltfläche, die verwendet eine drawable hintergrund der Art der shape drawable. Die relevanten Dateien:

background_button:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <stroke
        android:width="1px"
        android:color="#80ffffff" />
    <solid android:color="@android:color/transparent" />
</shape>

ripple.xml innerhalb der drawable-v21 Ordner:

<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?attr/colorControlHighlight">
    <item android:drawable="@drawable/background_button"/>
</ripple>

Button.xml:

   <Button
                    android:id="@+id/login_button"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:layout_weight="1"
                    android:paddingTop="10dp"
                    android:paddingBottom="10dp"
                    android:background="@drawable/ripple"


 />

Was ist hier falsch.
Danke!

InformationsquelleAutor user2511882 | 2015-12-24
Schreibe einen Kommentar