未加前缀的属性在style.xml中给出错误

时间:2013-05-16 13:44:43

标签: android android-actionbar actionbarsherlock

我使用actionbar sherlock与Android版本> = 8兼容 并且在使用代码时它会给我错误

error: Error: No resource found that matches the given name: attr 'titleTextStyle'.

我在xml中使用的代码是

<style name="MyTheme.ActionBarStyle" parent="@style/Widget.Sherlock.ActionBar">
  <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
  <item name="titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style>

2 个答案:

答案 0 :(得分:0)

您必须将构建SDK更改为至少API 11(Honeycomb)。

答案 1 :(得分:0)

我也使用AndroidSherlock ActionBar对此问题进行了实验。 EveryTime我在样式中改变了一些东西我得到了那些错误。关闭样式文件并clean -> rebuild通常为我修复