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 7824195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:30:57+00:00 2026-06-02T08:30:57+00:00

I am trying to create a custom title bar strictly for Android 2.1 that

  • 0

I am trying to create a custom title bar strictly for Android 2.1 that somewhat emulates the ActionBar found in Android 3.0 and up.

So far I’ve had fairly decent luck, but I cannot find an easy way to make the drop-down lists that can appear below the icon / buttons in the ActionBar.

I would like these drop-down lists to be able to cross the boundary between the title layout and the content layout without being clipped / cut off. I would also like the drop-down lists to be positioned relatively below the icons / buttons in the ActionBar. I’ve seen advice to use FrameLayouts and RelativeLayouts already but these did not seem to solve my particular problem (unless I’m looking at it wrong). I keep thinking it must be possible since I believe the newer versions of Android have support for exactly this type of behavior.

Here is a screenshot of what I am trying to accomplish with some notes.
http://img217.imageshack.us/img217/3279/67343249.png

Please help. Thanks!!!

  • 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-02T08:30:58+00:00Added an answer on June 2, 2026 at 8:30 am

    After a few days of research I found the best way to implement this is to use a custom dialog box with a custom theme that contains a listView. When the user clicks on the button the dialog should be displayed directly below the button. This provides a good user experience and also means you don’t have to completely change your basic layout structure to accomodate this functionality. (This is basically the same approach that ActionBar Sherlocke uses for their backwards compatibility menus)

    Here is a code snippet of what I’m describing (this is written in C# using Mono for Android but it should be easy to translate to Java):

    Dialog dlgHome = new Dialog(this, Resource.Style.ActionBarMenu);
    dlgHome.SetCanceledOnTouchOutside(true);
    dlgHome.SetContentView(Resource.Layout.ActionBarMenu);
    ListView lsvHome = (ListView)dlgHome.FindViewById(Resource.Id.lsvHome);
    lsvHome.Adapter = new ArrayAdapter<string>(this, Resource.Layout.ActionBarMenuItem, new string[] { "Add Activity", "Edit Log", "Program Details" });
    
    Rect r = new Rect();
    btnHome.GetLocalVisibleRect(r);
    int x = r.Left + (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 5, Resources.DisplayMetrics);
    int y = r.Bottom;
    
    WindowManagerLayoutParams param = dlgHome.Window.Attributes;
    param.Gravity = (int)(GravityFlags.Top | GravityFlags.Left);
    param.X = x;
    param.Y = y;
    dlgHome.Window.Attributes = param;
    

    Also, here is the style xml (goes in style.xml)

    <style name="ActionBarMenu" parent="android:Theme.Dialog">
    <item name="android:windowBackground">@color/actionbar_menu_bg</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:backgroundDimEnabled">false</item>
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a custom UIButton that should look like a UIButtonTypeRoundedRect. In
I am trying to create a custom property in a extended control, so that
I'm trying to create a PhoneGap application that in part, makes available a custom
I am trying to create a custom View that would replace a certain layout
I am trying to create a custom title layout but I'd still want to
I'm trying to create a custom view for my UITableView footerView that has a
i am trying to create a basic custom dialoge view on android witha few
Im trying to create a custom version of the RequiredAttribute to replace the built
I'm trying to create a custom component with a collection property. However if I
I'm trying to create a custom button where the foreColor is always crimson and

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.