How to remove a separator in front of an ITEM action bar menu that has only text?

I want to remove the short separator before the ActionBar MenuItem, which has the "withText" option.

I tried many different theme settings, but could not.

Is there any solution to remove it?

This is my xml theme.

 <style name="my_actionbar" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
    <item name="android:background">@drawable/actionbar_bg</item>
    <item name="background">@drawable/actionbar_bg</item>
    <item name="android:actionBarDivider">@null</item>
    <item name="actionBarDivider">@null</item>
    <item name="android:showDividers">none</item>
    <item name="android:dividerVertical">@null</item>
    <item name="android:dividerPadding">0dp</item>
    <item name="android:divider">@null</item>
</style>
+5
source share
4 answers

The attribute android:actionBarDividerbelongs to the theme, not to the style of the action bar. You can remove the delimiter as follows:

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

I solved this problem by setting the android: listDivider attribute on the main topic on some kind of transparent drawble. But I do not know the side effects of this setting.

Main theme:

<style name="Theme_Main" parent="@style/Theme.Sherlock.Light">
    ....
    <item name="android:listDivider">@drawable/shape_blank</item>
</style>

shape_blank.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
   android:shape="line">
    <solid android:color="@android:color/transparent"/>
</shape>
+1
source

.

  mTabHost.getTabWidget().setDividerDrawable(null);

  mTabHost.getTabWidget().setDividerDrawable(R.Color.transperant);
0
source

Use the code below in your snippet / Activity

getSupportActionBar().setElevation(0);
-1
source

All Articles