我試着像自定義通知佈局
RES /價值/ styles.xml
<resources>
<style name="NotificationTitle">
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
<item name="android:textStyle">bold</item>
</style>
<style name="NotificationText">
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
</style>
</resources>
RES /值-V9/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" />
<style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" />
</resources>
但值 - 創建資源v9我得到這個錯誤:
error: Error retrieving parent for item: No resource found that matches the given name
'android:TextAppearance.StatusBar.EventContent.Title'.
爲什麼?
謝謝,但我得到相同的:錯誤:檢索父項的錯誤:找不到匹配給定名稱'android:style/TextAppearance.StatusBar.EventContent'的資源。 – senzacionale
我忘記了android之前有一個'@'。嘗試使用'parent =「@ android:style/TextAppearance.StatusBar.EventContent」' –