The default toast of the Android system is very concise and easy to use. But sometimes our programs use the default toast and the overall style of the program, and this time we need to customize the toast to make it more integrated with our programs.
This example for you to share the Android micro-letter selection of the image of the specific code, and micro-letter photo function for your reference, the specific contents are as follows
1.android6.0 system, for the use of permissions are
Android Ui:listview--Simpleadapter
Simpleadapter is the most scalable adapter that can define the various layouts you want, and it's easy to use.
Layout:
Header layout:
Custom Layout item:
Recently nothing to do to write a popupwindow, hope to some people a little help.
As usual, look at the results after the completion (the interface is more ugly do not spit the groove)
Click on the location and then pop up the Popupwindow, the
Android:theme= "@android: Style/theme.dialog": Activity shown as dialog box mode
Android:theme= "@android: Style/theme.notitlebar": Do not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen": Do not
Three kinds of methods
1. Use XML file for definition Res/drawable/radio.xml
Copy Code code as follows:
Android:state_checked= "false"
android:drawable= "@drawable/tabswitcher_long"/>
Android:state_checked= "true"
Method One
Res/raw directory storage, such as Cwj.dat a binary file, we can read directly
Copy Code code as follows:
InputStream is=context.getresources (). Openrawresource (R.RAW.CWJ);
Method Two
In the Assets folder under
To create a proportional view, you can set the width and height of the linearlayout to Fill_parent, set the width or height of the child view to 0, and then set a different weight for the child view (weight) so that the size of the child view is
1. Use linear layout (linearlayout) and relative layout (relativelayout) As far as possible, do not use absolute layout.
2. Use dip and SP as far as possible, do not use PX.
3. Provide different layout files and pictures for different
1, the effect of the button progress
Before the idea: CSS to set the style of Div, in the JS to implement DIV to the event response, and change the style of div to achieve animation effect.
1: In the form of animation
Copy Code code as
In the activity, overwrite the following two methods:
Copy Code code as follows:
Create a Menu
@Override
public boolean
oncreateoptionsmenu(Menu menu) {
Menu.add (0, 0, 0, "about");
Menu.add (int groupId, int itemId, int
Android drop-down menu, such as in HTML, the key is to call the Setdropdownviewresource method, in XML to define the appearance of the Drop-down menu to display
Steps:
1. Define spinner control
Copy Code code as follows:
Android:id=
@drawable/icon@: On behalf of R.javaDrawable: Inner class drawableIcon:id is the object of iconConstant of the value in the drawable inner class in the R.java file that has the ID icon
Android:label= "title of Window">Represents the configuration
The status of the ToggleButton can only be checked and unchecked, and different display text needs to be set for different states.
The following case is the use of ToggleButton
Directory structure
Main.xml Layout file
Copy Code code as
Android:gravity: Sets the content position above the control itself
Android:layout_gravity: Sets the display position of the control itself relative to the parent control.
Look at the following code snippet
Copy Code code as follows:
Copy Code code as follows:
echo of a list of data
public void Shujulist () {
list customerlist = Dao.findall ();
Tablelayout tl = (tablelayout) Findviewbyid (r.id.tllayout);
LOG.I (">>>", String.valueof (Tl.getchildcount ()));
Int J =
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service