我不明白为什么堆叠ActionBar
我已经实现了最左边的选项卡和屏幕边缘之间有一个间隙。
最右侧选项卡的情况并非如此。
我尝试通过设计样式来删除分隔线ActionBar
。在尝试了一下样式后,我似乎能够覆盖 TabView 样式的属性,但不能覆盖TabBar
的风格ActionBarSherlock
.
<style name="ActionBarTabBarStyle.Dark" parent="@style/Widget.Sherlock.ActionBar.TabBar">
<item name="android:divider">@null</item>
<item name="android:showDividers">none</item>
<item name="android:dividerPadding">0dip</item>
</style>
然后我意识到我需要包含相同的无前缀属性。
ActionBar Sherlock 主题 http://actionbarsherlock.com/theming.html
Due to limitations in Android's theming system any theme customizations must be declared
in two attributes. The normal android-prefixed attributes apply the theme to the native
action bar and the unprefixed attributes are for the custom implementation. Since both
theming APIs are exactly the same you need only reference your customizations twice rather
than having to implement them twice.
但我尝试包含相同的无前缀属性,但这对我不起作用。
我尝试包含相同的无前缀属性。
<style name="ActionBarTabBarStyle.Dark" parent="@style/Widget.Sherlock.ActionBar.TabBar">
<item name="android:divider">@null</item>
<item name="android:showDividers">none</item>
<item name="android:dividerPadding">0dip</item>
<item name="divider">@null</item>
<item name="showDividers">none</item>
<item name="dividerPadding">0dip</item>
</style>
但它会抛出一个错误
Error: No resource found that matches the given name: attr 'dividerPadding'.
Error: No resource found that matches the given name: attr 'showDividers'.
所以然后我删除了这两个属性并尝试再次运行它,但我仍然看到标签栏分隔符。
<style name="ActionBarTabBarStyle.Dark" parent="@style/Widget.Sherlock.ActionBar.TabBar">
<item name="android:divider">@null</item>
<item name="android:showDividers">none</item>
<item name="android:dividerPadding">0dip</item>
<item name="divider">@null</item>
</style>
在我的 AndroidManifest.xml 文件中,我包括
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18"/>
对于可能出现的问题有什么建议或想法吗?
Update
我也尝试过
<style name="Theme.Dark" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarDivider">@null</item>
<item name="android:actionBarDivider">@null</item>
</style>
但这也没有消除分隔线。是否有另一个属性可以覆盖这些属性?