我想創建資源如下:
res/values/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/values-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>
但是對於 values-v9,有下面的錯誤:
error: Error retrieving parent for item: No resource found that matches the given name
'android:TextAppearance.StatusBar.EventContent.Title'.
為什麼啊?
我估計是由於父類屬性的錯誤格式造成的:
<style name="NotificationText" parent="@android:style/TextAppearance.StatusBar.EventContent" />
<style name="NotificationTitle" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" />