對於Android的 style 的 XML文件同樣也可以繼承
比如下面的 CodeFont 的style樣式:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CodeFont"parent="@android:style/TextAppearance.Medium">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
</style>
</resources>
如果我們想繼承 覆寫 CodeFont某些屬性 可以是 配置一個 CodeFont.xxx
例如:覆寫字體顏色
<stylename="CodeFont.Red">
<item name="android:textColor">#FF0000</item>
</style>
擴展屬性,例如字體大小
<stylename="CodeFont.Red.Big">
<item name="android:textSize">30sp</item>
</style>