Android development screen adaptation, android development adaptive
Solution 1: place a set of images in different dpi drawable. When the system reads the dpi of the mobile phone hardware, it automatically obtains the images in the corresponding drawable folder. This solution can only partially solve the problem.
Solution 2: recommended method; set the corresponding layout for mobile phones of different screens. For example, the resolution of MX3 mobile phone is 1800*1080, then add a new layout folder in the res folder named layout-1800x1080.
Some phones are 1280*720, a new layout is added as a layout-1280x720. In this case when your test machine is 1280x720 screen, it will read the layout inside the layout-1280x720, when it is a 1800*1080 screen, it will load the layout inside the layout-1800x1080.
When the screen of the test machine is in other circumstances, a bug occurs. the solution is to set a layout folder without parameters. When the test machine screen does not match the set accurate parameter layout, the layout in the layout folder without parameters is loaded.
Solution 2 has been tested, and the effect is good.