Reputation: 513
I am Switch view in android app. I need to change the background color of Text "ON" and Text "OFF" dynamically. Can anyone help me in solving this issue?
Upvotes: 2
Views: 967
Reputation: 1265
Use:
android:switchTextAppearance="@style/SwitchTextAppearance"
xml styles:
<style name="SwitchTextAppearance" parent="@android:style/TextAppearance.Holo.Small">
<item name="android:textColor">@color/#xxxxxx</item>
</style>
setSwitchTextAppearance(getActivity(), R.style.SwitchTextAppearance);
Upvotes: 1