The problem is - when I define a text color in styles:
<style name="Widget.App.SearcherButton" parent="Widget.AppCompat.Button">
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/buttontextcolor</item>
</style>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="@dimen/searcherButtonHeight"
android:background="@drawable/button"
android:theme="@style/Widget.App.SearcherButton"
android:textOn="@string/favButtonText"
android:textOff="@string/favButtonText" />
it won't work - meaning that the ToggleButton
will have the default text colo (black).
If I however set textColor
property directly on a ToggleButton
:
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="@dimen/searcherButtonHeight"
android:background="@drawable/button"
android:textColor="@color/buttontextcolor"
android:theme="@style/Widget.App.SearcherButton"
android:textOn="@string/favButtonText"
android:textOff="@string/favButtonText" />
Then it works. Why is that and how to make it work when declared in styles?