Android's eye-catching circle menu is a second-level high-imitation CCB circle menu
1. Overview
Today, I opened the China Construction Bank to check my deposits. When I saw my grief, I looked at it again. The circular menu was quite dazzling. So, in order to conceal my grief, I decided to achieve this effect. Well, there is actually another reason. I remember tha
In Android Menu Design (1): the Options menu is created using the XML file layout. But in actual development, you still need to pay attention to several issues. This article discusses related issues.
Before entering the formal topic, you need to know something.
1. Create option menus using XML
Note: When using menu.
I found that I spent a lot of time learning every android interface control. Because I am a beginner, I may still need to improve my learning methods and methods.
This document describes the basic implementation and usage of option menus and context menus.
The option menu is the bottom menu popped up by pressing the menu
Create a Menu
In Androidsdk, you do not need to create a menu object from scratch. Because an activity is associated with only one menu, Android creates this menu for the activity and then passes it to the oncreateoptionsmenu callback of the activities class. This me
A single menu is used as a menu, similar to the select tag in HTML. A dialog box is displayed, showing several options for selection. The screen size of the mobile phone is limited. If you use the radiogroup single-choice button, it will occupy a lot of space. The final results of today's example are as follows:
The spinner needs to bind an adapter arrayadapter and place the
1. Preparations
Download several images to make the menu a icing on the cake
2. Create an android Project
Create a folder named menu under the res file of the project to place the xml file. That is, the layout file of the menu.
The directory structure is as follows:
Game_menu.xml source code:
View plainAndroid: i
Invoke Action (as if it should be invoked, sorry). Add a description of Intent-fliter in Androidmanifest.xml, see: Pro Android Learning Note (11): Learn about Intent (medium).action Android:name= "Android.intent.action.VIEW" />category Android:name= "Android.intent.category.ALTERNATIVE"/>Alternative Menu CodeLet's see how to add the alternate menu to the Optionm
The Android SDK itself provides a mechanism for creating menus by default. However, the menu created through this mechanism is very functional, but it is a bit "dirt" in the interface effect. For a program with a gorgeous interface with a bit of "dirt" menu, will make the user feel very strange, and even make the gorgeous interface greatly compromised. In fact, m
Hello everyone, today we are talking about the design of the android function menu,
Program Two menu items are defined, one is "about" and the other is "exit". When you click "about", a new one is created.
Toast Prompt: When you click "exit", we will end the program.
In addition toOncreateIn addition, you also need to create two other class functions:Oncrea
Shortcut Key
To increase the operation speed of the option menu, you can add shortcuts to the menu on devices with physical buttons. the shortcut key can correspond to letters or numbers on the keyboard. you need to specify the android: alphabeticShortcut and android: numericShortcut attributes for the
For example, if
In the previous section, we have learned how to display the option MENU when pressing the MENU key. However, in addition to the option menu, you can also display a context menu. Context menus are usually associated with components in the activity. When you press a component for a long time, its context
The menu is a common user interface element, and there are 3 types of menus available in the Android system.(1) Options Menu: The menu displayed on the Device by menu key.(2) context menu: Long press a specific interface view disp
is, we can customize a layout to implement the sliding menu function in this custom layout, then, as long as we introduce our custom layout in the activity layout file, this activity has the function of sliding menu. The principle is over, isn't it easy? Let's implement it.
Create an android project in eclipse. The project name is renrenslanguinglayout.
Create a
= Class . forname ("Com.android.internal.view.menu.MenuBuilder"); Method m = Clazz.getdeclaredmethod ("Setoptionaliconsvisible", Boolean.class); m.setaccessible (true); M.invoke (menu, true); } catch (Exception e) { e.printstacktrace ();}}The background part is the key part of the code, the above method is my own add a method, in the Add icon only need to call this method on the line.This article is from the "Beginner" blog, so be sure to keep this s
Create submenusA sub-menu is a menu opened on a menu item of an existing menu. you can add sub-menus to any menu. when your program has many functions and can be organized by category, the sub-menu is the best choice. for example,
How to create a pop-up menu in Android development:1. First give the View Register context menu Registerforcontextmenu ();2. Add context menu Content Oncreatecontextmenu ():---can be added dynamically through code;---can load menu items in the XML file;3. Set
Before I told you about the history of the simplest way to implement the sliding menu, I believe we all remember. If you forget the implementation of the principle or have not seen the friends, please go to see the previous article Android sliding menu effects, imitation of the client side sideslip effect, the history of the most simple sideslip, because we want
StubExecutes when a menu element is selectedToast.maketext (this, item.gettitle () + "onmenuitemselected", 1). Show ();Return super.onmenuitemselected (Featureid, item);}}The second method:(Register context menu)public class Mainactivity extends Activity {Private TextView Username,password;@Overrideprotected void OnCreate (Bundle savedinstancestate) {TODO auto-generated Method StubSuper.oncreate (savedinst
infalter = Getmenuinflater (); infalter.inflate (R.menu.main,menu);//Instantiate main layout }Layout of XML filesListening to ContextMenu. @Override Public Boolean oncontextitemselected (MenuItem item) { switch (Item.getitemid ()) { case R.ID.MENU_ITEM1: toast.maketext (Mainactivity.this, "you chose to copy", Toast.length_short). Show (); break; Case R.ID.MENU_ITEM2:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.