Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use more android menu items in one row

I'm trying to use 6 android menu items in one row,but by default only 3 items are Passable. Is there any way to do that?

like image 642
besam Avatar asked May 28 '14 22:05

besam


People also ask

How to inflate menu android?

Implement the onCreateContextMenu() method in your Activity or Fragment . MenuInflater allows you to inflate the context menu from a menu resource. The callback method parameters include the View that the user selected and a ContextMenu.

How to create menu and menu groups?

Way to create menu directory and menu resource file: To create the menu directory just right-click on res folder and navigate to res->New->Android Resource Directory. Give resource directory name as menu and resource type also menu. one directory will be created under res folder.

How to load menu through XML?

Define an Android Menu in XML File In android, to define menu, we need to create a new folder menu inside of our project resource directory (res/menu/) and add a new XML file to build the menu with the following elements. It's a root element to define a Menu in XML file and it will hold one or more and elements.


1 Answers

No (unless you use a split action bar). From the documentation:

  • Action buttons in the main action bar may not occupy more than 50% of the bar's width. Action buttons on bottom action bars can use the entire width.
  • The screen width in density-independent pixels (dp) determine the number of items that will fit in the main action bar:
    • smaller than 360 dp = 2 icons
    • 360-499 dp = 3 icons
    • 500-599 dp = 4 icons
    • 600 dp and larger = 5 icons
like image 167
matiash Avatar answered Sep 19 '22 15:09

matiash