Poor menu layout

by Edward Falk » Thu, 05 Mar 2009 05:25:10 GMT


Sponsored Links
 Hi all; I took a bare-bones "hello world" application and added these
four menu items in onCreateOptionsMenu():

+--------------------------------------------+
|                    Start                   |
+--------------------------------------------+
|                    Find                    |
+----------------------+---------------------+
|Enable Location Provid|        About        |
+----------------------+---------------------+

[you'll need a fixed-width font to view this properly]

As you can see, the menu was very poorly laid out.  Making my 3rd
label shorter fixed the problem, but this definitely looks like broken
behavior to me.  Is there anything I'm doing wrong here?  The relevant
code is:

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    super.onCreateOptionsMenu(menu);
    menu.add(Menu.NONE, Menu.NONE, Menu.NONE,
R.string.menu_start_label);
    menu.add(Menu.NONE, Menu.NONE, Menu.NONE,
R.string.menu_find_label);
    menu.add(Menu.NONE, Menu.NONE, Menu.NONE,
R.string.enable_location);
    menu.add(Menu.NONE, Menu.NONE, Menu.NONE,
R.string.menu_about_label);
    return true;
  }


full source available at  http://www.efalk.org/tester3.tar.gz 

ADVthanksANCE,

  -ed falk
--~--~---------~--~----~------------~-------~--~----~