For Android components to use the flexibility of layouts and to accommodate screens of various sizes, you should use Wrap_content and match_parent to control the width and height of some view components.
With Wrap_content, the width and height of the view are set to the minimum size required to fit the content in the view, and match_parent (referred to as fill_parent at levels below API Level 8) expands the component to match the dimensions of its parent view.
If you use Wrap_content and match_parent dimension values instead of hard-coded dimensions, the view will use only the space or expansion that you want to fill the available space accordingly. This method allows the layout to properly accommodate various screen sizes and screen orientations.
How to calculate control weight in Android:
Android:layout_weight: If view sets this property and is valid, the view width is equal to the original width (android:layout_width) plus the remaining space.
This article is from the "Small Ant" blog, please make sure to keep this source http://16410743.blog.51cto.com/10657793/1691317
Android Component Width Height adaptive