ActionBarSherlock堆叠的行动酒吧造型问题

我无法弄清楚为什么堆叠的ActionBar我已经实现了最左边的选项卡和屏幕边缘之间的差距。

最左边的选项卡留下分隔线问题

最右边的标签不是这种情况。

最右边的选项卡没有分配器问题

我尝试通过deviseActionBar来删除分隔ActionBar 。 在玩了一些样式之后,似乎我可以覆盖TabView样式的属性,而不是ActionBarSherlockTabBar样式。

 <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> 

然后我意识到我需要包括相同的前置属性。

ActionBarSherlock主题

 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'. 

所以然后我删除了这两个属性,并试图再次运行,但我仍然看到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> 

在我的AndroidManifest.xml文件中,我包含了

 <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18"/> 

任何关于可能是什么问题的build议或想法?

更新

我也试过了

 <style name="Theme.Dark" parent="@style/Theme.Sherlock.Light.DarkActionBar"> <item name="actionBarDivider">@null</item> <item name="android:actionBarDivider">@null</item> </style> 

但是这也没有消除分隔线。 是否有另一个重写这些属性的属性?

您必须更改属于该主题的android:actionBarDivider属性,而不是操作栏样式android:divider 。 您可以像这样删除分隔线:

 <style name="AppTheme" parent="Theme.Sherlock"> <item name="actionBarDivider">@null</item> <item name="android:actionBarDivider">@null</item> </style> 

我会接受任何人的答复,涉及保持ActionBarSherlock,但是,我删除了这个库,现在我只是使用支持库,不再有间距问题。 我猜可能是ActionBarSherlock存在问题。 但是由于不再支持,我认为最好的解决scheme就是使用支持库。