First, to introduce the following about PX, PT, PPI, DPI, DP knowledge
Terms
Description
Px
(pixel), pixel, the most basic point on the screen to display data
Pt
(point), Dot 1pt=1/72 inch
Today, when writing tab, because the tab jump problem to check the data, but found more interesting problem is how to put the tab in the bottom of the screen.
Copy Code code as follows:
Android:id= "@android: Id/tabhost"
To share a high imitation micro-letter Popupwindow, it's the micro-mail sweep. That function window, below has the application Operation effect chart, more intuitive shows the demo effect, the source code is realizes through two kinds of methods,
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
The bottom pop-up box is often needed in the project, and here I'll tidy up one of the more convenient ways I use it (the bottom is a dialog with a horizontal full screen).
The effect diagram looks like this (only the key parts are shown):
The
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"
Test environment for adnroid more than 2.1.
1.androidmanifest.xml Permission Configuration:
To add Internet access rights:
Copy Code code as follows:
2. Asynchronous Picture class Imagedownloadtask
Copy Code code
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
Copy Code code as follows:
public class Menuex extends activity {
private static final String TAG = "android123";
@Override public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview
Android applications can easily complete these functions, many applications have "sharing" function? How to share it? Let's talk about it.
Recently, someone asked the Android sharing feature to use that better, using the Android intent to share it
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
Service Concept and use:
Android services, it is different from the activity, it can not interact with the user, can not start their own, running in the background of the program, if we quit the application, the service process is not over, it is
ListView Drop-down Refresh is very common, many open source framework can do this, of course, can also be achieved. This case is based on Xlistview.
Layout:
Code for the main activity:
Package Com.itydl.xlistviewdemo;
Recently this period of time has been looking at Android, using ListView to achieve the point of praise function, below to introduce the basic ideas.
Basic ideas:
Access to the interface – "Getting Data" –Show in ListView-"Save each row by
Android Interface Refresh
Android provides a invalidate method for interface refreshes, but invalidate cannot be invoked directly on the thread because he violates the Single-threaded model: Android UI operations are not thread-safe and must be
Uiscrollable is a uicollection and provides support for searching to items in a scrollable user interface (UI) elements. This class can is used with horizontally or vertically scrollable controls.
Uiscrollable is a uicollection (which is not yet
The strategy model is actually very simple (to hear this sentence, people are not in the heart suddenly relaxed? )。For example, the official tells everyone I have here a sort of interface isort the sort () method, and then the folk do their best to
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
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