How to show menu popup exact below actionbar?

I am working on popup-menu in actionbar. But I am stuck to display exact below of actionbar(cut-to-cut).I am putting two snapshot.

My issue screen shot:

  • When To Unregister Broadcast Receiver registered in onCreate?
  • How to add extra test runner parameter in Android Studio 2.3 instrumented tests
  • Detect when a fragment is drawn?
  • HonyComb and DefaultHttpClient
  • Genymotion devices not working in Eclipse on OS X Yosemite
  • enter image description here

    I want exact popup menu below of actionbar as below screenshot

    Correction screenshot:

    enter image description here

    My code snippet:

    <menu xmlns:android=""
    xmlns:tools="" tools:context=".MainActivity">
    <item android:id="@+id/action_filter"
        app:showAsAction="ifRoom" />
    <item android:id="@+id/action_label"
        app:showAsAction="ifRoom" />
    <item android:id="@+id/action_settings"
        app:showAsAction="never" />

    Related posts:

    GradientDrawable in Code
    Android NumberPicker not saving EditText changes
    Android ListView - stop scrolling at &#039;whole&#039; row position
    How can I use layout_width using resource file?
    Android Intent Chooser to only show E-mail option
    Not able to publish updated version of app in Google Play Store
  • Android: How to run asynctask from different class file?
  • Best way to handle events in Android
  • How to smoothly animate height in CSS or Javascript on mobile devices
  • setOnCancelListener and setOnDismissListener is not called for AlertDialog for back button pressed or touch outside
  • Filtering a cursor the right way?
  • Android coding best practices/design patterns
  • 5 Solutions collect form web for “How to show menu popup exact below actionbar?”

    Set the theme at android manifest to


    As per my code this is exact sotution by changing style.

    <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="android:actionMenuTextColor">@color/text_white</item>
        <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
        <item name="actionOverflowMenuStyle">@style/OverflowMenu</item>
    <style name="PopupMenu.Example" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
        <item name="android:popupBackground">#efefef</item>
    <style name="OverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow">
        <!-- Required for pre-Lollipop. -->
        <item name="overlapAnchor">false</item>
        <!-- Required for Lollipop. -->
        <item name="android:overlapAnchor">false</item>
        <item name="android:dropDownVerticalOffset">4.0dip</item>

    When working with AppCompat Theme, below code help you.Either Kitkat or Lollipop

    Make your style.xml like below

    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/black</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="actionOverflowMenuStyle">@style/OverflowMenu</item>
    <style name="OverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow">
        <item name="android:windowDisablePreview">true</item>
        <item name="overlapAnchor">false</item>
        <item name="android:dropDownVerticalOffset">5.0dp</item>
        <!--<item name="android:popupBackground">#FFF</item>-->

    If you want to keep using ActionBar and AppCompat theme rather than ToolBar or Holo theme, you can use this code:

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="actionOverflowMenuStyle">@style/MyOverflowMenu</item>
    <style name="MyOverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow">
        <item name="overlapAnchor">false</item>
        <item name="android:overlapAnchor" tools:ignore="NewApi">false</item>
        <item name="android:dropDownVerticalOffset">4.0dip</item>

    This worked for me.

    You can achieve this by style property
    overlapAnchor= false

     <style name="toolBarStyle" parent="AppTheme">
            <item name="popupTheme">@style/toolbarPopup</item>
        <style name="toolbarPopup" parent="@android:style/Widget.Holo.ListPopupWindow">  <!--ThemeOverlay.AppCompat.Light-->
            <item name="android:popupBackground">#AF0000</item>
            <item name="overlapAnchor">false</item>
            <item name="android:dropDownVerticalOffset">5dp</item>

    and set that style in AppTheme like below

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!--   to avoid overlay of popup window in toolbar -->
            <item name="actionOverflowMenuStyle">@style/toolBarStyle</item>
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.