2011-09-26 57 views
3

我一直在建立这个应用程序一段时间,并没有任何问题的主题,直到我今天更新到最新的平台工具。现在,它告诉我样式TextAppearance.Holo找不到

error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium.Inverse'. 
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium'. 
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Large'. 

error messages

这是我的styles.xml导致该问题的一部分,但是,正如我所说,它已经好几个月没改变,工作得很好,直到今天!

<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse"> 
    <item name="android:textColor">#FFF</item> 
    <item name="android:textStyle">bold</item> 
</style> 

<style name="BD.TextAppearance.Medium" parent="@android:style/TextAppearance.Holo.Light.Medium"> 
    <item name="android:textColor">#666666</item> 
    <item name="android:textSize">16sp</item> 
</style> 

<style name="BD.TextAppearance.Large" parent="@android:style/TextAppearance.Holo.Light.Large"> 
    <item name="android:textColor">#666666</item> 
    <item name="android:textSize">20sp</item> 
</style> 

- =编辑= - 我开始与价值观乱搞和事实证明,它并发现这些样式:

<style name="BD.TextAppearance" parent="@android:style/TextAppearance"> 
    <item name="android:textColor">#FFF</item> 
    <item name="android:textStyle">bold</item> 
</style> 

<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Medium.Inverse"> 
    <item name="android:textColor">#FFF</item> 
    <item name="android:textStyle">bold</item> 
</style> 

但不是这些:

<style name="BD.TextAppearance" parent="@android:style/TextAppearance.Holo"> 
    <item name="android:textColor">#FFF</item> 
    <item name="android:textStyle">bold</item> 
</style> 

<style name="BD.TextAppearance.Medium.Inverse" parent="@android:style/TextAppearance.Light.Medium.Inverse"> 
    <item name="android:textColor">#FFF</item> 
    <item name="android:textStyle">bold</item> 
</style> 

回答

1

我仍然不知道为什么发生这种情况,但我找到了解决办法。我从Android SDK复制了styles.xml文件,并将其粘贴到我的项目中,并拿出了我没有使用的所有样式。我改变了所有'父'声明,包括'@android:'前缀,并在'?'之后添加了'android:'。为所有属性。这允许它编译和运行。但就像我说的,我真的很想知道为什么它首先打破了!

+0

你现在找到原因了吗? – KarlKarlsom

+0

不,我只是一旦得到它的工作就跟着它。 – CaseyB

+0

@CaseyB,你是否编译为平台的一部分?我问,因为看起来TextAppearance.Holo.Light由于某种原因而不公开(即使TextAppearance.Holo是公开的)。如果您正在编译平台,您将能够看到这些样式,但是如果您正在编译SDK,它将无法找到它们。只是一个想法。 –

0
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Holo.Light.Medium.Inverse'. 

我也面临同样的问题我所做的只是我删除了

parent="@android:style/TextAppearance.Holo.Light.Medium.Inverse"属性。它将起作用检查它。

+0

问题在于它不采用这些样式的预设!我想我可以定义每个属性。 – CaseyB