<span id="Label3"></p><p><p>Method two,</p></p><p><p>drawable-ldpi, 120ppi</p></p><p><p>drawable-mdpi, 160ppi</p></p><p><p>drawable-hdpi, 240ppi</p></p><p><p>drawable-xhdpi, 320ppi</p></p><p><p>DRAWABLE-XXHDPI 480ppi</p></p><p><p>300ppi mobile phone will choose 320ppi corresponding to the resources under the drawable directory,</p></p><p><p>Method three,</p></p><p><p>It can be seen that they occupy the same length and width, the advantage of this autoscale is that only one picture can adapt to the various PPI types of Screen.</p></p><p><p>The disadvantage is that when the image of the 100x100 to transform into a 200x200 image will be able to cause the image is not clear, if provided a drawable-xhdpi under the picture resources, the picture more words will be invisible increase the size of the application, so say how to choose is also a measure.</p></p><p><p>The recommendation is to provide multiple versions of the more important picture Resources. It's not important. the image resource stores a version that allows the system to display the appropriate scale of the image according to its own ppi.</p></p><p><p> </p></p><p><p></p></p><p><p>Android Multi-resolution adaptation is a very meaningful but troublesome things, there are many on the internet on the multi-resolution adaptation of the article, most of the article is about the entire App's picture comparison rules, You can make the picture into 9 diagram to complete the multi-resolution adaptation, But for some game applications (the game here is not using the game engine), the Low-age Children's application, The app has a lot of fancy pictures, this app's picture obviously can't make 9 diagram, on the Internet to check a lot of information has no more ideal solution, Take a look at the multi-resolution adaptation for this scenario with your recent projects:</p></p> <ul> <ul> <li><p>In order to reduce the workload of the ui, an app only provides a set of graphs;</p></li> <li><p>To reduce the repetitive work of programmers, an app only maintains a set of programs;</p></li> <li><p>In order to not distort the various resolution slices, the UI provides the picture at the highest resolution;</p></li> <li><p>In order to achieve the desired effect, the picture segmentation as thin as possible, will have the effect of the picture and the background separation (such as the background of the app has trees, flowers, characters, These small scenes from the background image cut out, the programmer himself will be affixed to the picture, just different resolution of the size, location is not the Same. );</p></li> <li><p>For the picture does not distort, the picture width height must be equal to the scale;</p></li> <li><p>In principle, the program only has a layout, for the special requirements of the place, you can create multiple sets of layout folder, for the mainstream resolution to provide the corresponding layout files;</p></li> <li><p>The programmer creates multiple sets of values folders, and the Dimens.xml file under the folder holds the image size and coordinates of the corresponding Resolution.</p></li> <li><p>Pull out the common layout and introduce it in the form of include tags where you need to use it.</p></li> </ul> </ul><p><p><strong>Note:</strong></p></p> <ul> <ul> <li><p>The above scheme basically solves the problem of Multi-resolution adaptation (the project probably only needs to fit 4-5 models), for the resolution of a large difference or the screen size is too large, you can consider to do two sets of UI and two sets of procedures, so as to achieve a more ideal effect, For example, many apps offer mobile and pad versions of two apps.</p></li> <li><p>Multi-resolution adaptation The common practice is to create multiple layout folders at the same resolution under the same set of programs, but in development I find that you can also create multiple values folders by resolution, such as: values-1230x800, values-1920x1200, values-1969x1536, values-974x768, for creating different folders by resolution in particular, it is necessary to note that:</p></li> </ul> </ul> <ol> <ol> <li><p>Format: folder Name-large value x Decimal value (large value in front, decimal value in the back);</p></li> <li><p>The value in the folder name is not the actual resolution of the machine, it needs to lose the height of the notification bar;</p></li> <li><p>The same resolution in the case of vertical and horizontal screen is two different folders, such as the resolution is 1024x768, the notification bar height of 50, then the screen corresponding folder Is: values-1024x718, portrait of the corresponding folder for values-974x768.</p></li> </ol> </ol><p><p>DP (density-independent Pixel) is a density-independent pixel unit, or dip. It is an abstract unit based on the physical density of the device Screen. 1DP indicates the length of 1px at the screen dpi of 160. The higher the DPI screen, the more pixels the screen will need to draw 1dp, and Vice Versa.</p></p><p><p></p></p><p><p>Summary: by adding the above limits can be achieved by an APK suitable for several mainstream screen size and screen density, This limited method is suitable for external release applications, do not know the specific parameters of the terminal, but can not be accurately adapted to the screen size and density of the two platforms are not very good distinction.</p></p><p><p></p></p><p><p>In order to solve the above problems, since Android3.2, the introduction of accurate adaptation, in theory can be adapted to any pixel width, height, screen density of the platform, you need to add a qualifier in the following ways</p></p><p><p></p></p><p><p></p></p><p><p>It is believed that designers will generally use the latest IPhone5 (5s and 5 size and resolution are the Same) to do the prototype design, and IPhone5 screen resolution of 640x1164, screen size of 4 inches, according to the Pythagorean theorem (a^2 + b^2 = c^2) 640^2+1164^2= 1764496, and then open the square root of the screen to find the resolution of the Diagonal: 1328, divided by 4 can be obtained iphone5 dpi:1328/4≈332 can be seen IPhone5 screen dpi is about 320, just belong to xhdpi, So you can be very proud like your designers say not specifically for the Android side transduction, directly to the Iphone's set of cut picture resources into the drawable-xhdpi folder is Ok.</p></p><p><p></p></p><p><p>Android--screen adaptation</p></p></span>
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