I'm styling ToggleButtons, and I got an image to use as the new background, for all 6 states (default on, default off, pressed on, pressed off, disabled on, disabled off) as 9-patches. The problem is that when applied the textOn and textOff properties seem to be ignored, they work with the default style, but not with this one.
This is what the 9-patch for one of the looks like:
And this is the style applied in the Theme:
<style name="Widget.Button.Toggle" parent="android:Widget.Button.Toggle">
<item name="android:background">@drawable/toggle_button_selector</item>
<item name="android:textColor">@color/white</item>
<item name="android:textSize">20sp</item>
</style>
This is the relevant portion in the layout:
<ToggleButton
android:id="@+id/toggleButton"
android:textOn="@string/settings_mediospago_valor_personalizado"
android:textOff="@string/settings_mediospago_valor_por_defecto"
android:gravity="center"
android:layout_width="200dp"
android:layout_height="50dp"
/>
And this is how it looks:
Any pointers?