Thank you !!!
Reprinted Please note: http://blog.csdn.net/richway2010/archive/2011/06/29/6574987.aspx
Bloggers: All bloggers, netizens, and everyone on the Internet! Welcome to this blog. You are welcome to have more exchanges, give more comments, learn from each other, and make mutual progress. Our slogan is: study hard and make progress every day .]
Go directly to the topic to see the effect:
Touch the screen
the standard Android phone screen, the so-called standard is the density of 160dpi, resolution of 320x480, density of 240dpi, The screen resolution is 480x800, of course, not including the tablet, this kind of tablet usually refers to the domestic
of the size of the chalk and the corresponding relationship, for the development of Android games can take into account the future of 3.0 and a lot of tablet needs.Conventional we may only consider QVGA,HVGA,WVGA,FWVGA and DVGA, but left the phone to talk about, may use the tablet like WSVGA 1024x576 and WXGA 1280x768 and so on.QVGA = 320 * 240;WQVGA = 320 * 480
1. Overview
The Android fragmentation problem is a nightmare for every developer, and this article summarizes the Android adaptation issue in a comprehensive way.
First of all, look at the official report released by Google August 1, 2016:Relative numbers of devices related to the Android platform version:You can see that the 4.1 version and above a
Widgets and Qt Quick apps
How does the android layout adapt to different screen sizes?
You can calculate the space occupied by your popupwindow in real time. For example, if your initial parameter is 300pxX250px, you 'd better instantly convert dp to px./*** Convert the dip or dp value to the px value to ensure that the size remains the same** @ Param dipValue* @ Param scale* (Density in DisplayMetric
This article describes a fun appImplementation ideas: Use a custom view on a transparent activity and then draw on the view. 9 of broken glass pictures, plus sound effects. And then disappear for a while.The main use of a postinvalidate () method, with a set to put the finger touched place, call Postinvalidate () in the Touch event, method to redraw the view.It is important to note that the playback sound is the same as the play sound in the previous
the split-line footage in the drawable-nodpi, and the picture in the resource folder will be displayed in the actual pixel size, rather than being scaled by Android based on density. That is, the thin line in the MDPI is 2px (2DP), and the thin line in the xhdpi is 2px (1DP).The above is a preliminary summary of the Android screen, I do not know if you read afte
Android screen adaptationOfficial address: http://developer.android.com/guide/practices/screens_support.htmlI. Recommendations on layout adaptation1, do not use absolute Layout 2, try to use match_parent instead of fill_parent. 3, can use the weight of the place as far as possible the use of weight (android:layout_weight) 4, if it is a solid color background, as far as possible using the shape of
Today to introduce the Android in the slide screen function of a basic implementation process and principle, and finally give you the key to explain the view of the Scrollto and Scrollby the difference between the two functions.
First, we have to understand that there is no boundary to the Android view, canvas, except that we do something about the canvas object
).The above is a preliminary summary of the Android screen, I do not know if you read after the enlightened, or confused? This article is mainly for practical purposes, avoid too much in-depth analysis, if you have any questions, you can leave a message.----------------------------------------------------------Finally, many friends asked me the design of the Android
Android Screen Toggle Summary (Android data)Android screen to solve the problem should be two:I. Layout issues Two. Reload the problem1. Layout problem: If you do not want the software to switch between the screen, the simplest wa
[Android] about the system toolbar and full screen immersion mode, android immersion
I have written several related articles about System Bars:
[Android] Get the height of the Status Bar and Navigation Bar at the top of the system
[Android] Status Bar
[
1. Foreword
Now there are a lot of Android phones to support the screen unlock, tapping screen unlock is a very useful function, but a dozen support tapping screen, and then only for unlock or lock screen, and then our application layer developers can not go in, completely
complies with the rule of ldpi: mdpi: hdpi: xhdpi: xxhdpi = 3: 4: 6: 8: 12.
If you make a 2x7 splitting material into a 9.png image, what if you want to make the thin lines 2px in different density instead of being scaled by Android? You can put the split line material in drawable-nodpi. The images in this resource folder will be displayed according to the actual pixel size, instead of being scaled by Android
, the requirements for API level are above 9, which means that the tablet or mobile phone of your Android system does not match Layout-xlarge at all. Because the API level is 8. Drawable-tvadpi requires more than 13 API levels.
In fact, the preceding Layout-large directory is actually a range. When the system determines the directory that the program should match based on the size and density of the current
Android screen adaptation has always been a headache for developers, because Android devices vary in size, and screen display is not the same, how to screen adaptation to Android is a big challenge, in order to deal with different
and prohibit the use of absolute layout, because there are many problems with absolute layout.
Using qualifiers
Using Dimension Qualifiers
Res/layout/main.xml, single panel (default) layout.
Res/layout-large/main.xml, double panel layout.
Note the large qualifier in the second layout name directory. The system selects this layout on devices that are part of a larger screen, such as a 7-inch or larger tablet
dpnormal screens are at least 470dp x 320 dpsmall screens are at least limit DP x 320dp here the width and high value are actually given and there is no separate comparison significance, the final result is the product of it. That is to say, the minimum screen must have 426*320 = 136,320 dp, and at least 470*320 = 150,400 dp to become a medium screen. The list is as follows: smal = 136,320 normal = 150,400
documents: Beginning with Android 3.2 (API level 13), the above size groups are deprecated and you shoshould instead usesw
dp
Configuration qualifier to define the smallest available width required by your layout resources. For example, if your multi-pane tablet layout requires at least 600dp of screen width, you should place it inlayout-sw600dp/. That i
changed.In the look, using DP as the unit, the physical size has not changed much.Anyway, the development of Android, the general will use DP to specify the size of a component. Of course, occasionally someone will use pixels (px) to specify the size of the component, may be a novice, or perhaps the person's program does not want to be compatible with more devices.The above explains what DP,DP is a fundamentally device-independent unit that guarantee
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.