对于自定义的 action bar,我在 xml 中使用下面的代码:
<style name="CustomActionbarTheme" parent="@style/Theme.AppCompat.Light">
<item name="actionBarTabStyle">@style/customTab</item>
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">
<item name="background">@drawable/title_bar</item>
</style>
<style name="customTab" parent="@style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">@drawable/tab_bg_selector</item>
</style>
使用 api level 10 没有问题,但是当我在高点的 api 设备上运行代码时,action bars 是默认的主题。
我在程序中使用的是 library v7。
为什么这个 action bar 不能运行呢?