If a toolbar is unable to display all the user's currently configured toolbar items, it pushes the additional items into the overflow menu and displays the overflow menu icon as shown in Figure 1.
An application can determine if a toolbar has overflow items by comparing the number of items returned by the method items with the number of items returned by the visibleItems method as shown in Listing 1. If these values differ, then the toolbar has items in the overflow menu.
Listing 1 Example code to test if a toolbar has overflow items
int numberOfItems=[[theToolbar items] count]; |
int numberOfVisibleItems=[[theToolbar visibleItems] count]; |
if (numberOfItems != numberOfVisibleItems) { |
// toolbar has overflow items |
} |
Last updated: 2007-01-08