Android - 缺少父母主题?

Jos*_*osh 3 xml android styles

我试图按照这篇博文发布ActionBar的样式:

http://android-developers.blogspot.com/2011/04/customizing-action-bar.html

有了这个源代码:

svn checkout http://styled-action-bar.googlecode.com/svn/trunk/ styled-action-bar-read-only

但是,我遇到了问题/res/values/styles.xml.

这个:

<!-- style for the tabs -->
<style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBarView_TabView">
    <item name="android:background">@drawable/actionbar_tab_bg</item>
    <item name="android:paddingLeft">32dp</item>
    <item name="android:paddingRight">32dp</item>
</style>
Run Code Online (Sandbox Code Playgroud)

是错误的:

Error retrieving parent for item: No resource found that matches the given name 'android:style/Widget.Holo.Light.ActionBarView_TabView'.

但是,使用以下答案,并挖掘Android的源代码,我可以看到主题确实存在:

/sf/answers/500457261/

我在项目中唯一改变的是从移动它android-11android-14,然后运行在Eclipse中的"Android">"修复项目属性".我注意到在那个列出样式的答案中链接的repo是在分支主机上,所以我不明白为什么主题不会被解开.

仅仅是为了测试,我把那大块代码放在我的工作android-14目标应用程序中,减去背景可绘制,并且它会抛出相同的错误.

mat*_*784 8

根据/sf/answers/548642951/中的链接,有一个Widget_Holo_Light_ActionBar_TabView但不是Widget_Holo_Light_ActionBarView_TabView.自编写该教程以来,资源可能已重命名.它表示自API级别13以来已经包含没有额外"视图"的版本 - 如果教程最初是在11上编写的,则它可能在13中重命名,并且由于您运行14,因此您只能看到重命名的版本.我尝试删除无关的"视图",看看代码是否运行.