In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how to implement a menu system in Android". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to implement a menu system in Android.
Icon menu of ◆ Android menu system
When the Menu button is pressed, this compact menu (figure 1-1) is displayed at the bottom of the screen. It displays menu items (submenus) with up to 6 icons and text.
This icon menu does not display checkbox,radio button and shortcut keys as menu items, so it is generally good practice not to specify checkbox or radio button as menu items because they will not be available.
If more than 6 menu items are defined, More menu items are included, and when selected, an extended menu is displayed. Press the Back button to close the icon menu.
Extended menu of ◆ Android menu system
The extended menu is triggered when the user selects a More menu item from the icon menu. The extension menu (figure 1-2) shows a list of scrollable menu items (those that are not visible in the icon menu). Full text, keyboard shortcuts, checkbox and radio button can be displayed in this menu.
Figure 1-2
Then, it does not display icons. Therefore, you should avoid assigning icons to menu items that may only appear in the extension menu.
Press the Back button to return to the icon menu from the extended menu.
You can't force Android to use extended menus instead of icon menus. Therefore, you need to pay special attention to the fact that those checkbox or radio button menu items can only be used in the extended menu or their status information is displayed in icons or text instead.
Submenus of the ◆ Android menu system
The traditional "extended hierarchical tree" is clumsy for mouse navigation, so it's not surprising that this kind of thing is particularly inappropriate for mobile devices. The workaround of Android is to use a floating window to display each submenu. For example, when the user selects the submenu marked Submenu in figure 1-2, its menu items are displayed on a floating menu dialog box, as shown in figure 1-3.
Figure 1-3
Note: the name of the submenu is displayed on the headline (Header bar), and its submenu is displayed as full text, checkbox (if necessary), keyboard shortcuts, etc. Because Android does not support nested submenus, you cannot add submenus to submenus (an attempt will cause an exception).
At this point, I believe you have a deeper understanding of "how to implement a menu system in Android". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.