before Setcontentview, deprecated)@Override protectedvoidonCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //设置主题 setTheme(R.style.AppTheme); setContentView(R.layout.layout_portrait); }2, using the system's own themeCommon system theme such as:3, custom themestyle name="MyTheme" [parent="继承的主题"] item name="ATTR">[VALUE]style>4, example of frosted glass effectFrosted Glass Effect: is the interface that many programs start at first,
Define styles and themes Res/values/style. xml
Res/values/string. xml
Layout file layout/Main. xml
Java code:
Import android. app. activity; import android. OS. bundle; public class styleandthemeactivity extends activity {/** called when the activity is first created. * // @ override public void oncreate (bundle savedinstancestate) {// set the topic setthem
Android _ How to switch themes or skins1. Introduction
By using a custom topic or skin, you can place the related configurations (color, size, and so on) in a new apk compressed file. The directory structure remains consistent, the apk file can be placed in any accessible directory, like/system/framework/framework-res.apk, can dynamically load the theme file according to the needs of the software. Here we
Use of Menu level 1 Menu and level 2 Menu of Android learning notes, and android learning notes
(1) No changes have been made to the layout file.
(2) the code in the main. xml file under the res -- menu directory is as follows:
Understanding the Menu of Android is an indispensable part of many applications. Especially in Android, all mobile phones carrying Android systems even have a "Menu" key, this shows the particularity of menus in Android programs.
Note that the menu here does not appear on the menu as it appears on the machine, but is based on the android.view.animation.TranslateAnimation provided by the Android SDK (extends Android.view.animation.Animation) class instance is appended to a Layout to produce a menu of animated and hidden effects.Principle: Layout
ObjectiveToday saw the pro Android 3 menu in this chapter, the whole Android menu system has a further understanding, so take notes to share with you.PS: Highly recommended "Pro Android 3", is the best I have seen so far the Android
Android context menu implementation, android context menu
1. overwrite the onCreateContenxtMenu () method of the Activity, and call the add method of Menu to add a Menu item (MenuItem ).2. overwrite the onContextItemSelected () me
Android-Implementation of custom drop-down menu and android drop-down menu
Reprinted please indicate the source: http://blog.csdn.net/l1028386804/article/details/48101651
Android-developed shoes generally encounter such a situation that the original pull-down control Spinner
Use of Android slide menu DrawerLayout and android slide menu
Currently, many slide menus are used, mostly through SlidingMenu. You can also use DrawerLayout
Create drawer Layout
Frament_content.xml
Activity_main.xml
Create a new class to inherit the Fragment class
/*** ContentFragment. java * copyright (C) 201
Arc menu (Android), arc menu android
Arc menu (Android)
Preface:The company needs to write an arc menu!
Effect:
Development Environment: AndroidStudio2.2.1 + gradle-2.14.1
Knowled
[Do not talk about it, just go to the Code]
[Java]Package com. bison;Import android. app. Activity;Import android. OS. Bundle;Import android. text. Html;Import android. view. ContextMenu;Import android. view. ContextMenu. ContextMenuInfo;Import
Android-satellite-menu Implementation Click the Main button, will pop up a plurality of buttons arranged around the main button, thus forming a satellite pop-up menu. The animation of the child buttons popping up and disappearing is great. This pop-up menu button is applied in Path2.0. Usage in your V Add a componen
The previous article on "Learning to understand Android menu menus" briefly introduces Android's menu, and today let's take a look at how to create and respond to the most commonly used option menus (Options menu) through code.
First, create Options menu
As mentioned earli
Create an option menu
The option menu should contain basic activity actions and required navigation entries (for example, a menu item set to open the program ). option menu items have two different options: one is the menu item button, and the other is the Action Bar (in
())){MPopupWindow. dismiss (); // enter the pop window that simulates the menu to exit.Return true;}Return false;}});
Sub_view is a subview of PopupWindow.Sub_view.setFocusableInTouchMode (true );Sub_view.setOnKeyListener (new OnKeyListener (){@ OverridePublic boolean onKey (View v, int keyCode, KeyEvent event ){// TODO Auto-generated method stubIf (keyCode = KeyEvent. KEYCODE_MENU) (mPopupWindow. isShowing ())){MPopupWindow. dismiss (); // enter t
.
Order: the menu display sequence. The Android system displays the menu item in ascending order from left to right, top to bottom, according to the value of the?? The parameter must be 0 and a positive integer and cannot be a negative integer.
Titleres and Title: The string resource ID or string of the menu it
Here are some other features that you can apply to most menu entries.
Menu GroupA menu group is composed of a series of menu items that share certain features. For a group, you can:
Show or hide all menu items. Use setGroupVisible ()Enable or disable all
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.