The android project was developed in the previous phase. Due to customer requirements for Multi-Resolution adaptation, it can support mainstream resolution mobile phones in China. Therefore, after several development times, many detours have taken place. At present, we have just learned some android multi-resolution adaptation methods.
First, we will introduce the detour. Because the layout file of android is stored in the layout of res, you can specify the specific layou parameter based on the resolution of different mobile phones ,:. Set multiple layout parameter layout files based on different mobile phones. Therefore, when the program is loaded, the layout file running at the resolution is displayed. The problem with this development is that there are a lot of layout files, which is messy. Inconvenient to manage. Many layout files need to be modified once modified. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + zai5/bfWzva3tLHg0uuyzr + fill + weight/weight + dmFsdWVzyejWw7PJtuDM16Gjus/A7bXEsry + Weight = "http://www.2cto.com/uploadfile/Collfiles/20140529/2014052909234647.png" alt = "\">. It can be seen that layout is a set of layout, but drawable can be multiple sets when resources are required. It is specially adapted based on different resolutions. The corresponding values must be multiple sets. In addition, the adaptation of values has all the corresponding data from low resolution 800x432 to high resolution 1280x752. In addition, hdpi and xhdip are independently adapted according to the density. This makes the code easier to maintain.
Therefore, based on the obtained information, I reconstructed the project. The following is the layout file after reconstruction ,.
Since there are not many image resources, we use a set of drawable and layout to use multiple sets of corresponding values. Run on different mobile phones. It basically meets the user experience. The data is completely displayed, and the effect is not distorted.