1. The best way to adapt the screen to multiple resolutions may be to use the weight attribute.
You can use the Layout_weight property in a linetype layout to make the control appear proportionally. This will result in a consistent display at different screen resolutions.
There are two ways to use this property:
1. Set the value of Layout_width or layout_height (depending on whether you want to display proportionally on length or width) to match_parent.
In this case, the smaller the weight value, the larger the area. The disadvantage of this method is that the proportions need to be computed by themselves, because it is reversed.
2. Set the value of Layout_width or layout_height (depending on whether you want to proportionally display the length or width) to 0 px.
In this case, the larger the weight value, the greater the area.
However, the weight property is not valid for relative layout. So you need to be careful when you use it.
************************************************************************************
2. You can also use code to get the screen resolution layout. The advantage is accuracy, disadvantage is trouble. Because the size of all the controls needs to be reset in the code, it's very cumbersome. This method is not suitable for many layout situations in the project.
3. You can also design a separate layout for each resolution. Disadvantage or trouble, because there are so many resolutions. The pros are still accurate.
An article is available for reference:
Http://www.eoeandroid.com/thread-173973-1-1.html