您好,登錄后才能下訂單哦!
對(duì)于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>
如果我們想繼承 覆寫(xiě) CodeFont某些屬性 可以是 配置一個(gè) CodeFont.xxx
例如:覆寫(xiě)字體顏色
<stylename="CodeFont.Red">
<item name="android:textColor">#FF0000</item>
</style>
擴(kuò)展屬性,例如字體大小
<stylename="CodeFont.Red.Big">
<item name="android:textSize">30sp</item>
</style>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。