Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:35:53+00:00 2026-06-07T12:35:53+00:00

Is there a way to show Divider between the Menu Items in ActionBar for

  • 0

Is there a way to show Divider between the Menu Items in ActionBar for HoneyComb+.

Some post says that the Divider will be shown only when the menu items has android:showAsAction=”withText”.

I want to show only the Icon not the Text.

I successfully shown Divider for Pre-HoneyComb by implementing a Action Bar Compatibility.

I dont want to use ActionBarSherlock as given in this post Android actionbar sherlok doesn't show divider because it will be time to change from Action Bar Compatibility to ActionBarSherlock in my all Projects.

When i saw the Android Source i found that Divider will be show only when it has text as shown below (from ActionMenuItemView)

public boolean needsDividerBefore() {
    return hasText() && mItemData.getIcon() == null;
}

public boolean needsDividerAfter() {
    return hasText();
}

Is there a way that I can give my Implementation for ActionMenuItemView for ActionBar where needsDividerBefore() will always give true

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:35:55+00:00Added an answer on June 7, 2026 at 12:35 pm

    I found an answer by myself with help of http://android-developers.blogspot.in/2011/04/customizing-action-bar.html However, this does not completely solve my problem. It adds a divider for Title, and also one for the home Icon. There are also left and right separators. That too is adjustable.

    I added android:selectableItemBackground to my theme.

    <item name="android:selectableItemBackground">@drawable/action_bar_item_selector</item>
    

    action_bar_item_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    
        <item android:drawable="@drawable/actionbar_compat_separator"></item>
    
        <item android:left="1dp" android:drawable="@drawable/actionbar_compat_item"></item>
    
    </layer-list>
    

    actionbar_compat_separator – is my seperator drawable

    and actionbar_compat_item is my selector for action bar item.

    EDITED

    I have found a better solution to my problem. It works well.

    <item name="android:actionButtonStyle">@style/ActionButton</item> to my Theme
    
    <style name="ActionButton" parent="android:style/Widget.Holo.Light.ActionButton">
            <item name="android:background">@drawable/action_bar_item_selector</item>
        </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to show the SQL that Django is running while performing
Is there way to show users that the website page started loading. My homepage
is there a way to show all tables that have a specific number of
Is there a way to show up a menu, when i click on any
Is there a way to show all classes that implement a certain method from
Is there a way to show all the shortcut keys that have been defined
Is there any way to show differences (on commits info) between two versions of
Is there a way to show any error message if IIS(5.1) is stopped or
Is there a way to show the public interface of a package in eclipse?
Is there a way to show different fonts/font-sizes depending on whether it's a Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.