I created a drawable for my ToggleButtons
, but I also need to show an icon.
How can I do this if there's just a background attribute?
Here's the ToggleButton
drawable:
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke android:color="#CED2D4" android:width="1dp" />
<solid android:color="#EDEEEF"/>
</shape>
And the code to place the ToggleButton
(currently using IconFont, but I have to change as the items are dynamic):
<ToggleButton
android:id="@+id/toggleCreditCard"
android:layout_width="@dimen/width_filter_facilities_button"
android:layout_height="@dimen/height_filter_facilities_button"
android:background="@drawable/filter_service_toggle_default"
android:textOff="@string/fa_credit_card"
android:textOn="@string/fa_credit_card" />