要创建自定义ToggleButton,我在以下位置定义了一个新样式/res/values/styles.xml:
<style name="myToggleButton">
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textColor">#000000</item>
    <item name="android:background">@drawable/my_toggle_button</item>
</style>
然后我使用选择器指定按钮状态的外观/res/drawable/my_toggle_button.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true">
        <shape>
            [...]
        </shape>
    </item>
    <item android:state_checked="false"
        <shape>
            [...]
        </shape>
    </item>
</selector>
当状态发生变化时,如何修改此设置以切换按钮的文本颜色?