效果如下图:

通过xml文件来设置主题和样式:
style文件自定义样式和主题的代码:
< xml version="1.0" encoding="utf-8" >
//设置父主题,取自TextAppearance
//设置子主题
//设置颜色
#FF0000
#00FF00
#0000FF
xml文件:
< xml version="1.0" encoding="utf-8" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:id="@+id/textView1"
style="@style/tmacskyTheme.textBlue"
android:text="TextView1" />
android:id="@+id/textView2"
style="@style/tmacskyTheme.textGreen"
android:text="TextView2" />
style="@style/tmacskyTheme.textRed"
android:id="@+id/textView3"
android:text="TextView3" />
相关阅读: