Android Multi-resolution adaptation experience summary

Source: Internet
Author: User

?? 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:

    • In order to reduce the workload of the UI, an app only provides a set of graphs;

    • To reduce the repetitive work of programmers, an app only maintains a set of programs;

    • In order to not distort the various resolution slices, the UI provides the picture at the highest resolution;

    • 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. );

    • For the picture does not distort, the picture width height must be equal to the scale;

    • 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;

    • 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.

    • Pull out the common layout and introduce it in the form of include tags where you need to use it.

Note:

    • 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.

    • 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:

    • Format: Folder name-large value x decimal value (large value in front, decimal value in the back);

    • The value in the folder name is not the actual resolution of the machine, it needs to lose the height of the notification bar;

    • 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.

Android Multi-resolution adaptation experience summary

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.