Reputation: 255
Can I combine my own android drawable and ?android:selectableItemBackground...? I searched a lot but I can't find the right answer... For example lets say I have a simple button and I want this:
<Button
android:id="@+id/bTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackground" | @drawable/myDrawable/>
Any ideas?
Upvotes: 6
Views: 6200
Reputation: 147
How about using FrameLayout
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/myDrawable">
<Button
android:id="@+id/bTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackground"/>
</FrameLayout>
or using ImageButton
<ImageButton
android:id="@+id/bTest"
android:src="@drawable/myDrawable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackground"/>
Upvotes: 3