too*_*o42 5 android theming actionbarsherlock android-actionbar android-styles
我无法弄清楚为什么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>
Run Code Online (Sandbox Code Playgroud)
然后我意识到我需要包含相同的无前缀属性.
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.
Run Code Online (Sandbox Code Playgroud)
但我试图包含相同的无前缀属性,但这对我没有用.
我试图包含相同的无前缀属性.
<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>
Run Code Online (Sandbox Code Playgroud)
但它会引发错误
Error: No resource found that matches the given name: attr 'dividerPadding'.
Error: No resource found that matches the given name: attr 'showDividers'.
Run Code Online (Sandbox Code Playgroud)
那么我删除了这两个属性并尝试再次运行它,但我仍然看到tabbar dividiers.
<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>
Run Code Online (Sandbox Code Playgroud)
在我的AndroidManifest.xml文件中,我包含了
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18"/>
Run Code Online (Sandbox Code Playgroud)
关于可能是什么问题的任何建议或想法?
我也试过了
<style name="Theme.Dark" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarDivider">@null</item>
<item name="android:actionBarDivider">@null</item>
</style>
Run Code Online (Sandbox Code Playgroud)
但这并没有消除分隔线.是否有另一个属性覆盖这些属性?
我会接受任何涉及保留 ActionBarSherlock 的答案,但是,我删除了这个库,现在我只是使用支持库,并且不再遇到间距问题。我猜想 ActionBarSherlock 可能有问题。但由于它不再受支持,我认为最好的解决方案就是使用支持库。