Versuchen, etwas wirklich einfaches hier zu tun und haben eine Reihe von SO-Ressource nachgeschlagen, aber ohne Erfolg. Ich versuche, den Welleneffekt auf eine Taste zu bekommen, die einen drawable
Hintergrund vom Typ shape drawable
verwendet. Die entsprechenden Dateien:Ripple-Effekt auf die Form ausziehbar
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 im 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!
Dies scheint eine anständige Lösung. Ich werde das ausprobieren und bald ein Update veröffentlichen. Vielen Dank! – user2511882
Das mache ich schon lange. Es bietet Konsistenz von Api-Ebene 7 bis 23. Ich hoffe, es wird für Sie funktionieren – tasomaniac
Leider., Das funktioniert nicht. – user2511882